Example #1
0
 public override void OnEnter()
 {
     if (Vector3.Distance(transform.position, trigger.findPlayerInScene()) > 2)
     {
         Finish();
         return;
     }
 }
    public override void OnEnter()
    {
        SetPosition(awareCollider.findPlayerInScene());

        if (!CheckTrigger())
        {
            Finish();
            return;
        }
    }
 private void LateUpdate()
 {
     if (Vector3.Distance(transform.position, trigger.findPlayerInScene()) <= 1)
     {
         if (fsm.GetCurrentStateName() == "AlertState")
         {
             fsm.SendEvent("ToMelee");
         }
     }
 }