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

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