public void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject.tag != "Player")
     {
         ActivateHittables.HitAll(collision.gameObject, gameObject.GetComponent <PlayerAttack>());
     }
 }
Exemple #2
0
    public void ActivateAttack(PlayerAttack attack)
    {
        attackActive = attack;

        for (int i = 0; i < collidedObjects.Count; ++i)
        {
            ActivateHittables.HitAll(collidedObjects[i], attackActive);
        }
    }
    public void ActivateAttack(PlayerAttack attack)
    {
        attackActive         = attack;
        attackActive.Forward = transform.forward;

        if (player != null)
        {
            ActivateHittables.HitAll(player, attackActive);
        }
    }
Exemple #4
0
 public void OnTriggerEnter(Collider other)
 {
     print(other.gameObject.name);
     if (attackActive != null)
     {
         ActivateHittables.HitAll(other.gameObject, attackActive);
         collidedObjects.Add(other.gameObject);
     }
     else
     {
         collidedObjects.Add(other.gameObject);
     }
 }
 public void OnTriggerEnter(Collider other)
 {
     if (other.tag.Equals("Player"))
     {
         if (attackActive != null)
         {
             ActivateHittables.HitAll(other.gameObject, attackActive);
         }
         else
         {
             player = other.gameObject;
         }
     }
 }