コード例 #1
0
    /*
     * IEnumerator Fade()
     * {
     *  if (UiManager.isgaming())
     *  {
     *      GameObject forfade = null;
     *      forfade = this.transform.FindChild("defult").gameObject;
     *
     *      for (float i = 1f; i >= 0; i -= 0.02f)
     *      {
     *          Color color = new Vector4(1, 1, 1, i);
     *          forfade.GetComponent<MeshRenderer>().material.color = color;
     *          yield return 0;
     *
     *      }
     *
     *  }
     *  else
     *  {
     *      Color color = new Vector4(1, 1, 1, 1f);
     *      this.color = color;
     *      yield return 0;
     *
     *  }
     * }
     */

    private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("BULLET"))
        {
            audio.Play();
            HP--;
            //HP -= other.gameObject.GetComponent<PlayerBulletController>().Damage;
            if (HP == 0)
            {
                Die();
                KillManager.setKillScore();//킬스코어 올리기
                if (KillManager.killscore == ARGameController.end)
                {
                    KillManager.resetKillScore();
                    UiManager.scopeMessenger = false;
                    SceneManager.LoadScene("Win");//승리시 win 씬으로
                }
            }
        }
    }
コード例 #2
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("BULLET") && UiManager.isUnbeatable == false)
        {
            HP--;
            // HP -= other.gameObject.GetComponent<EnemyBulletController>().Damage;
            UiManager.shootedMessenger = true;//피격 이펙트
            beat.Play();
            Handheld.Vibrate();
            if (HP == 0)
            {
                Destroy(gameObject);
                KillManager.resetKillScore();
                UiManager.scopeMessenger = false;
                SceneManager.LoadScene("Over");
            }
        }

        /* else if (other.CompareTag("START"))
         * {
         *   s
         * }*/
    }