示例#1
0
        protected override void OnSetup()
        {
            cachedTurn = Agent.GetAbility <Turn>();
            cachedMove = Agent.GetAbility <Move>();
            if (Sight < Range)
            {
                _sight = Range;
            }

            fastRange        = (Range * Range);
            attackFrameCount = AttackRate;
            basePriority     = cachedBody.Priority;
            CanMove          = cachedMove.IsNotNull();
            if (CanMove)
            {
                cachedMove.onArrive         += HandleOnArrive;
                cachedMove.onGroupProcessed += _HandleMoveGroupProcessed;
            }

            CanTurn          = cachedTurn.IsNotNull();
            CachedOnHit      = OnHit;
            CachedAgentValid = this.AgentValid;
        }
示例#2
0
        protected override void OnSetup()
        {
            cachedTurn = Agent.Turner;
            cachedMove = Agent.Mover;
            if (Sight < Range)
            {
                _sight = Range;
            }
            baseDeltaCount  = InfluenceManager.GenerateDeltaCount(Sight);
            rangeDeltaCount = InfluenceManager.GenerateDeltaCount(Range);

            fastRange        = (Range * Range);
            attackFrameCount = AttackRate;
            basePriority     = cachedBody.Priority;

            CanMove = cachedMove.IsNotNull();
            if (CanMove)
            {
                cachedMove.OnArrive         += HandleOnArrive;
                cachedMove.onGroupProcessed += _HandleMoveGroupProcessed;
            }

            CanTurn = cachedTurn.IsNotNull();
        }
示例#3
0
        protected override void OnSetup()
        {
            cachedBody = Agent.Body;
            cachedTurn = Agent.Turner;
            cachedMove = Agent.Mover;
            if (Sight < Range)
                _sight = Range;
            baseDeltaCount = InfluenceManager.GenerateDeltaCount(Sight);
            rangeDeltaCount = InfluenceManager.GenerateDeltaCount(Range);

            fastRange = (Range * Range);
            attackFrameCount = AttackRate;
            basePriority = cachedBody.Priority;

            CanMove = cachedMove .IsNotNull();
            if (CanMove)
            {
                cachedMove.OnArrive += HandleOnArrive;
                cachedMove.onGroupProcessed += _HandleMoveGroupProcessed;
            }

            CanTurn = cachedTurn .IsNotNull();
        }
示例#4
0
 protected override void OnSetup()
 {
     cachedBody = Agent.Body;
     cachedBody.OnContact += HandleCollision;
     cachedTurn = Agent.Turner;
     collisionStopTreshold = FixedMath.Mul (timescaledSpeed,CollisionStopTreshold);
     collisionStopTreshold *= collisionStopTreshold;
     timescaledAcceleration = Acceleration * 32 / LockstepManager.FrameRate;
     if (timescaledAcceleration > FixedMath.One) timescaledAcceleration = FixedMath.One;
     closingDistance = cachedBody.Radius;
     if (closingDistance < FixedMath.One / 4) closingDistance = closingDistance;
     stuckTolerance = ((Agent.Body.Radius * Speed) >> FixedMath.SHIFT_AMOUNT) / LockstepManager.FrameRate;
     stuckTolerance *= stuckTolerance;
 }