Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class AttackCone : MonoBehaviour {
- public TurretAI turret;
- public bool isLeft = false;
- private void Awake()
- {
- turret = gameObject.GetComponentInParent<TurretAI>();
- }
- private void OnTriggerStay2D(Collider2D col)
- {
- if (col.CompareTag("Player"))
- {
- if (isLeft)
- turret.Attack(false);
- else
- turret.Attack(true);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement