// Update is called once per frame void Update() { EyeRokState state = currentState.Update(this); if (state != null) { currentState = state; currentState.OnEnter(this); } }
// Start is called before the first frame update void Start() { Player = GameObject.FindGameObjectWithTag("Player"); navAgent.updateRotation = false; navAgent.updateUpAxis = false; LeftHandCollider = LeftHand.GetComponent <BoxCollider2D>(); RightHandCollider = RightHand.GetComponent <BoxCollider2D>(); currentState = new EyeRokPatrol(); currentState.OnEnter(this); }
public override void SetDestination(Vector2 target) { base.SetDestination(target); StartCoroutine(EyeRokState.WaitForSeconds(3.0f, () => Destroy(gameObject))); }