Ejemplo n.º 1
0
    private void TurnOnLostConnectionNotification()
    {
        StopAllCoroutines();
        StartCoroutine(Twiner.ImageSmoothAlphaChange(0, 0.65f, Background));

        LostConnectionPanel.GetComponent <RectTransform>().localScale = Vector2.zero;
        StartCoroutine(Twiner.PanelSmoothScaleChange(0, 1, LostConnectionPanel));
    }
Ejemplo n.º 2
0
    public IEnumerator FlickVirusOnStart()
    {
        StartCoroutine(Twiner.VirusFlicker(gameObject));
        LastTail.GetComponent <Tail>().FlickOnAwake();
        IsNotFlicker = false;

        yield return(null);
    }
Ejemplo n.º 3
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (IsNotFlicker)
        {
            #region PeopleCollision
            if (collision.CompareTag("People"))
            {
                AddScore();
                PlayPeopleEatSound();

                OnPeopleEat?.Invoke();

                if (collision.name != "D_People")
                {
                    StartCoroutine(Twiner.UnsizeAndReposition(Spawner.NewPeoplePosition(), collision.gameObject));
                }

                if (collision.name == "D_People")
                {
                    StartCoroutine(Twiner.UnsizeAndDestroy(collision.gameObject));
                }
            }
            #endregion

            #region VirusCollision
            if (collision.GetComponent <Tail>() != null && collision.name != gameObject.name)
            {
                if (collision.GetComponent <Tail>().head.IsNotFlicker)
                {
                    PlayerCamera.Singletone.SetMoveTarget(collision.gameObject);
                    PlayDeathSound();
                    Death();
                }
            }

            if (collision.GetComponent <VirusHead>() != null && collision.name != gameObject.name)
            {
                VirusHead head = collision.GetComponent <VirusHead>();

                if (head.IsNotFlicker)
                {
                    if (head.Wide >= Wide)
                    {
                        PlayerCamera.Singletone.SetMoveTarget(collision.gameObject);
                        PlayDeathSound();
                        Death();
                    }
                }
            }
            #endregion
        }

        if (collision.name == "PlayArea")
        {
            Stun(collision);
        }
    }
Ejemplo n.º 4
0
    private IEnumerator StartFlickOnAwake()
    {
        StartCoroutine(Twiner.VirusFlicker(gameObject));

        if (nextBody != head.gameObject)
        {
            nextBody.GetComponent <Tail>().FlickOnAwake();
        }

        yield return(null);
    }
Ejemplo n.º 5
0
    private IEnumerator StartGrowVirus()
    {
        if (nextBody != head.gameObject)
        {
            nextBody.GetComponent <Tail>().GrowVirus();
        }

        yield return(null);

        StartCoroutine(Twiner.GrowVirus(gameObject, head.gameObject));
    }
Ejemplo n.º 6
0
    private IEnumerator StartAddBodyEffect()
    {
        if (nextBody != head.gameObject)
        {
            nextBody.GetComponent <Tail>().AddTailEffect();
        }

        yield return(new WaitForSeconds(_deathDelay * 5));

        StartCoroutine(Twiner.GrowBodyAtNewBody(gameObject, 0.25f, 0.4f));
    }
Ejemplo n.º 7
0
    internal virtual void AddWide()
    {
        StartCoroutine(Twiner.GrowVirus(gameObject, gameObject));
        LastTail.GetComponent <Tail>().GrowVirus();

        NumberOfTailsToGrowUp += 2;
        ScoreToAddTail        += 8;

        TailCounter = 0;
        Wide++;
    }
Ejemplo n.º 8
0
 public void TurnOnNotificationPanel()
 {
     if (!_isPanelActive)
     {
         _isPanelActive = true;
         StartCoroutine(Twiner.ImageSmoothAlphaChange(0, 0.65f, Background));
         Panel.GetComponent <RectTransform>().localScale = Vector2.zero;
         StartCoroutine(Twiner.PanelSmoothScaleChange(0, 1, Panel));
         StartCoroutine(FlickConnectionIcon());
         StartCoroutine(MainMenuLoadDelay());
     }
 }
Ejemplo n.º 9
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.CompareTag("People") && collision.name != "D_People")
        {
            _numOfPeopleUnderSplash++;
            StartCoroutine(Twiner.UnsizeAndReposition(Spawner.NewPeoplePosition(), collision.gameObject));
        }

        if (collision.CompareTag("People") && collision.name == "D_People")
        {
            _numOfPeopleUnderSplash++;
            StartCoroutine(Twiner.UnsizeAndDestroy(collision.gameObject));
        }
    }
Ejemplo n.º 10
0
    private IEnumerator SmoothAddSize()
    {
        float targetSize = _camera.orthographicSize + 0.5f;
        float step       = 0;

        do
        {
            _camera.orthographicSize += Twiner.SmoothSquarer(step);
            step += Time.deltaTime;
            yield return(null);
        }while (_camera.orthographicSize < targetSize);

        _camera.orthographicSize = targetSize;
    }
Ejemplo n.º 11
0
    public void ShowPanel(GameObject panel)
    {
        StartCoroutine(Twiner.PanelSmoothScaleChange(0, 1, panel));

        if (_currentOpenedPanel != null)
        {
            StartCoroutine(Twiner.PanelSmoothScaleChange(1, 0, _currentOpenedPanel));
        }

        else
        {
            StartCoroutine(Twiner.ImageSmoothAlphaChange(0, 0.65f, Background));
        }

        _currentOpenedPanel = panel;
    }
Ejemplo n.º 12
0
 public void CloseIAPPanel()
 {
     StartCoroutine(Twiner.PanelSmoothScaleChange(1, 0, _currentOpenedPanel));
     StartCoroutine(Twiner.ImageSmoothAlphaChange(0.65f, 0, Background));
     _currentOpenedPanel = null;
 }
Ejemplo n.º 13
0
 public void SignOnPurse()
 {
     declineSellSkinSound.CheckIsAudioEnabledAndPlay();
     StartCoroutine(Twiner.UISigner(purseGameObject));
 }
Ejemplo n.º 14
0
 internal void SingOnCost()
 {
     shopPanel.declineSellSkinSound.Play();
     GetComponent <RectTransform>().localScale = new Vector3(1, 1, 0);
     StartCoroutine(Twiner.UISigner(gameObject));
 }
Ejemplo n.º 15
0
 public void TurnOffLostConnectionNotification()
 {
     StopAllCoroutines();
     StartCoroutine(Twiner.ImageSmoothAlphaChange(0.65f, 0, Background));
     StartCoroutine(Twiner.PanelSmoothScaleChange(1, 0, LostConnectionPanel));
 }