コード例 #1
0
    public void LoseLife()
    {
        StartCoroutine(pacStudent.DeadTrigger());

        lives--;
        Destroy(uiManager.lives[lives]);
        uiManager.lives.RemoveAt(lives);
    }
コード例 #2
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.CompareTag("Player"))
        {
            PacStudentController pacStudent = collision.GetComponent <PacStudentController>();

            if (isNormal)
            {
                StartCoroutine(pacStudent.DeadTrigger());
                gameManager.LoseLife();
            }
            else if (isScared || isRecovering)
            {
                if (!isDeath)
                {
                    UiManager.Instance.UpdateScore(300);
                    SetDeath();
                }
            }
        }
    }