Exemplo n.º 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;
        }
Exemplo n.º 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();
        }
Exemplo n.º 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();
        }
Exemplo n.º 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;
 }