示例#1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.GetComponent <IPossessable>() != null)
     {
         if (collision.GetComponent <IPossessable>().IsPossessed)
         {
             Death.PlayerHasDeath(cause);
         }
         else
         {
             collision.gameObject.SetActive(false);
         }
     }
 }
示例#2
0
        private void Update()
        {
            //Debug.Log(CanTakeDamage + " : " + Health);

            if (!player.inBody && !isCoR)
            {
                if (CanTakeDamage)
                {
                    StartCoroutine(DamageOverTime());
                }
            }


            // if dead - die
            if (Health <= 0 && !hasCalledDeath)
            {
                string[] _deathMessages = new string[] { "Faded Away...", "AFK", "Froze in horror" };
                Death.PlayerHasDeath(_deathMessages[Random.Range(0, _deathMessages.Length - 1)]);
                hasCalledDeath = true;
            }

            SpectreAnim();
        }