void Die() { CancelInvoke(); animator.SetTrigger("shouldDie"); var point = 35; PointController.GetInstance().ShowPoint(point); Destroy(gameObject, 2.0f); }
public void ShowDeadMenu() { deadCanvas.SetActive(true); AdManager.Instance.ShowAd(CBLocation.GameScreen); if (!SceneSettings.Instance.IsTutorial) { PointController.GetInstance().SubmitScore(); long point = PointController.GetInstance().GetPoint(); var scoreBoard = deadCanvas.transform.Find("ScoreBoard").gameObject; var scoreText = scoreBoard.transform.Find("ScoreText").gameObject; scoreText.GetComponent <Text> ().text = "" + point; var chatText = scoreBoard.transform.Find("ChatText").gameObject; chatText.GetComponent <Text>().text = KilledByTexts.texts[killedBy]; var bestText = scoreBoard.transform.Find("BestText").gameObject; bestText.GetComponent <Text> ().text = "" + PointController.GetInstance().GetBest(); } }
public void Die() { if (killedBy == KILLED_BY_SLIDE) { animator.SetTrigger("fall_die"); audioSource.PlayOneShot(hit2); } else if (killedBy == KILLED_BY_SLASH) { animator.SetTrigger("headOff"); audioSource.clip = hit; audioSource.loop = false; audioSource.PlayDelayed(0.1f); } else { animator.SetTrigger("die"); audioSource.PlayOneShot(hit2); } var point = 0; switch (killedBy) { case KILLED_BY_JUMPED_ON: point = 10; break; case KILLED_BY_SLASH: point = 25; break; default: point = 5; break; } PointController.GetInstance().ShowPoint(point); foreach (Collider2D col in GetComponents <Collider2D>()) { col.enabled = false; } mRigidbody.isKinematic = true; }