private void TurnOnLostConnectionNotification() { StopAllCoroutines(); StartCoroutine(Twiner.ImageSmoothAlphaChange(0, 0.65f, Background)); LostConnectionPanel.GetComponent <RectTransform>().localScale = Vector2.zero; StartCoroutine(Twiner.PanelSmoothScaleChange(0, 1, LostConnectionPanel)); }
public IEnumerator FlickVirusOnStart() { StartCoroutine(Twiner.VirusFlicker(gameObject)); LastTail.GetComponent <Tail>().FlickOnAwake(); IsNotFlicker = false; yield return(null); }
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); } }
private IEnumerator StartFlickOnAwake() { StartCoroutine(Twiner.VirusFlicker(gameObject)); if (nextBody != head.gameObject) { nextBody.GetComponent <Tail>().FlickOnAwake(); } yield return(null); }
private IEnumerator StartGrowVirus() { if (nextBody != head.gameObject) { nextBody.GetComponent <Tail>().GrowVirus(); } yield return(null); StartCoroutine(Twiner.GrowVirus(gameObject, head.gameObject)); }
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)); }
internal virtual void AddWide() { StartCoroutine(Twiner.GrowVirus(gameObject, gameObject)); LastTail.GetComponent <Tail>().GrowVirus(); NumberOfTailsToGrowUp += 2; ScoreToAddTail += 8; TailCounter = 0; Wide++; }
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()); } }
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)); } }
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; }
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; }
public void CloseIAPPanel() { StartCoroutine(Twiner.PanelSmoothScaleChange(1, 0, _currentOpenedPanel)); StartCoroutine(Twiner.ImageSmoothAlphaChange(0.65f, 0, Background)); _currentOpenedPanel = null; }
public void SignOnPurse() { declineSellSkinSound.CheckIsAudioEnabledAndPlay(); StartCoroutine(Twiner.UISigner(purseGameObject)); }
internal void SingOnCost() { shopPanel.declineSellSkinSound.Play(); GetComponent <RectTransform>().localScale = new Vector3(1, 1, 0); StartCoroutine(Twiner.UISigner(gameObject)); }
public void TurnOffLostConnectionNotification() { StopAllCoroutines(); StartCoroutine(Twiner.ImageSmoothAlphaChange(0.65f, 0, Background)); StartCoroutine(Twiner.PanelSmoothScaleChange(1, 0, LostConnectionPanel)); }