Esempio n. 1
0
 public override void End(EndCause cause,string msg = " end action ")
 {
     if (timer != null)
     {
         timer.Stop(owner != null && !owner.IsDead);
     }
     base.End(cause);
 }
Esempio n. 2
0
 public override void End(EndCause cause,string msg = " end action ")
 {
     owner.OnShootEnd -= OnShootEnd;
     ((AgentControl)owner.Control).Stop(false);
     base.End(cause,msg);
 }
Esempio n. 3
0
    private void EndAttack(EndCause obj)
    {
        switch (obj)
        {
            case EndCause.no:
                StartAttack(false);
                break;
            case EndCause.runAway:

                break;
        }
    }
Esempio n. 4
0
    private void EndComeHome(EndCause byHit)
    {
        isHome = true;
//        if (aiStatus == AIStatus.returnHome)
//            return;
        StartWalk(byHit);
        
    }
Esempio n. 5
0
 private void StartWalk(EndCause byHit)
 {
     aiStatus = AIStatus.walk;
     int coef = 60;
     if (Action is MoveAction)
     {
         coef = 30;
     }
     var shalgo = UnityEngine.Random.Range(0, 100) < coef;
     if (shalgo)
     {
         var randPos = new Vector3(bornPosition.x + UnityEngine.Random.Range(-isHomeDist, isHomeDist),
             bornPosition.y,
             bornPosition.z + UnityEngine.Random.Range(-isHomeDist, isHomeDist));
         Action = new MoveAction(this, randPos, StartWalk);
     }
     else
     {
         Action = new StayAction(this, StartWalk);
     }
     
 }
Esempio n. 6
0
 public virtual void End(EndCause cause = EndCause.no, string msg = " end action ")
 {
     //Debug.Log(msg);
     if (owner != null && endCallback != null && !owner.IsDead)
         endCallback(cause);
 }