コード例 #1
0
 public TargetSearchWanderingState(UnitAIWithTarget ai, Vector2 searchPoint, bool runAlongTargetVelocity) : base(0.25f)
 {
     this.ai                     = ai;
     this.searchPoint            = searchPoint;
     this.runAlongTargetVelocity = runAlongTargetVelocity;
     this.hasCheckedSearchPoint  = false;
 }
コード例 #2
0
 public DamagedNewTargetSearchState(UnitAIWithTarget ai) : base(ai)
 {
 }
コード例 #3
0
 public DamagedState(UnitAIWithTarget ai, Vector2 hitNormal)
     : base(Random.Range(0.2f, 0.4f))
 {
     this.ai        = ai;
     this.hitNormal = hitNormal;
 }
コード例 #4
0
 public TargetSearchState(UnitAIWithTarget ai, Quaternion lookAt) : this(ai) {
     destAngle = lookAt.eulerAngles.z;
 }
コード例 #5
0
 public TargetSearchState(UnitAIWithTarget ai) : base(interval: 1f)
 {
     this.ai = ai;
 }
コード例 #6
0
        /*public Unit GetClosestTarget(Vector2 position) {
         *  //Vector2 position = requester.owner.position;
         *  var fact = GetClosest
         *  return fact?.unit;
         * }*/

        private static Unit GetAnyTarget(IEnumerable <UnitAIWithTarget> among, out UnitAIWithTarget witness)
        {
            witness = among.FirstOrDefault(x => x.target.Is());
            return(witness?.target);
        }
コード例 #7
0
 public ZombiePursuingTarget(UnitAIWithTarget ai) : base(interval: 0.2f)
 {
     this.ai = ai;
 }