Advertisement
CakeMeister

Attack Cone phan 12

Jul 6th, 2017
1,164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.55 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class AttackCone : MonoBehaviour {
  6.  
  7.     public TurretAI turret;
  8.     public bool isLeft = false;
  9.  
  10.  
  11.     private void Awake()
  12.     {
  13.         turret = gameObject.GetComponentInParent<TurretAI>();
  14.        
  15.     }
  16.  
  17.     private void OnTriggerStay2D(Collider2D col)
  18.     {
  19.         if (col.CompareTag("Player"))
  20.         {
  21.             if (isLeft)
  22.                 turret.Attack(false);
  23.  
  24.             else
  25.                 turret.Attack(true);
  26.  
  27.  
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement