public override void End(EndCause cause,string msg = " end action ") { if (timer != null) { timer.Stop(owner != null && !owner.IsDead); } base.End(cause); }
public override void End(EndCause cause,string msg = " end action ") { owner.OnShootEnd -= OnShootEnd; ((AgentControl)owner.Control).Stop(false); base.End(cause,msg); }
private void EndAttack(EndCause obj) { switch (obj) { case EndCause.no: StartAttack(false); break; case EndCause.runAway: break; } }
private void EndComeHome(EndCause byHit) { isHome = true; // if (aiStatus == AIStatus.returnHome) // return; StartWalk(byHit); }
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); } }
public virtual void End(EndCause cause = EndCause.no, string msg = " end action ") { //Debug.Log(msg); if (owner != null && endCallback != null && !owner.IsDead) endCallback(cause); }