public override void StartAction() { if (fgoRequest != null && fgoRequest.IsInRange()) { fgoRequest = null; StartAttack(); } else { fgoRequest.StartAction(); } }
public override MoveRequest GetRequest() { if (gameObjectToFollow == null) { return(null); } else { float attackRange = MovingObjectStats.GetAttackRangeForObject(gameObject); FollowGameObjectRequest request = new FollowGameObjectRequest(0.5f, this, attackRange); request.targetObject = gameObjectToFollow; if (request.IsInRange()) { return(null); } return(request); } }
public override MoveRequest GetRequest() { if (path == null || pathIndex >= path.Length) { return(null); } FollowGameObjectRequest request = new FollowGameObjectRequest(0.5f, this, minDistanceToEachObject); request.targetObject = path [pathIndex]; if (request.IsInRange()) { if (++pathIndex < path.Length) { request.targetObject = path [pathIndex]; } else { return(null); } } return(request); }