Example #1
0
    void OnCollisionEnter2D(Collision2D _colInfo)
    {
        PPlayerHealth _player = _colInfo.collider.GetComponent <PPlayerHealth>();

        if (_player != null)
        {
            _player.TakeDamage(stats.damage);
            //TakeDamage(999999);
        }
    }
Example #2
0
 void Awake()
 {
     playerhealth = FindObjectOfType <PPlayerHealth>();
     try
     {
         healthbar = GameObject.FindGameObjectWithTag("HealthBar").GetComponent <PHealthBar>();
     }
     catch
     {
     }
 }
Example #3
0
 public static void KillPlayer(PPlayerHealth player)
 {
     Destroy(player.gameObject);
 }
Example #4
0
 void Awake()
 {
     playerhealth = FindObjectOfType <PPlayerHealth>();
 }