public static void Pool(MovementGroup group)
        {
            int indexID = group.indexID;

            activeGroups.RemoveAt(indexID);
            pooledGroups.Add(group);
        }
 public static void StopCoroutine(Coroutine _coroutine)
 {
     if (_coroutine.Active == false)
     {
         Debug.LogError("Coroutine already stopped");
     }
     Coroutines.RemoveAt(_coroutine.Index);
     _coroutine.Active = false;
     _coroutine.End();
 }
Exemplo n.º 3
0
        internal static void Dessimilate(LSBody body)
        {
            int tid = body.ID;

            if (!SimObjects[tid].IsNotNull())
            {
                Debug.LogWarning("Object with ID" + body.ID.ToString() + "cannot be dessimilated because it it not assimilated");
                return;
            }

            SimObjects[tid] = null;
            CachedIDs.Add(tid);


            if (body.DynamicID >= 0)
            {
                DynamicSimObjects.RemoveAt(body.DynamicID);
                body.DynamicID = -1;
            }
        }
Exemplo n.º 4
0
 public static void RemoveController(AgentController agentController)
 {
     Selector.Clear();
     AgentControllers.RemoveAt(agentController.PlayerIndex);
     if (MainController == agentController)
     {
         if (AgentControllers.Count == 0)
         {
             MainController = null;
         }
         else
         {
             for (int i = 0; i < AgentControllers.PeakCount; i++)
             {
                 if (AgentControllers.arrayAllocation [i])
                 {
                     MainController = AgentControllers [i];
                     break;
                 }
             }
         }
     }
 }
Exemplo n.º 5
0
        public static void LateSimulate()
        {
            //TODO: Look into this
            int inactiveFrameThreshold = LockstepManager.FrameRate * 8;


            for (int i = 0; i < RanCollisionPairs.PeakCount; i++)
            {
                if (RanCollisionPairs.arrayAllocation[i])
                {
                    var instancePair = RanCollisionPairs[i];
                    var pair         = RanCollisionPairs[i].Pair;

                    if (instancePair.Version != instancePair.Pair._Version)
                    {
                        //pair is removed at Deactivate so no longer possible
                    }
                    else
                    {
                        if (pair._ranIndex >= 0)
                        {
                            RanCollisionPairs.RemoveAt(pair._ranIndex);
                            pair._ranIndex = -1;
                            InactiveCollisionPairs.Add(instancePair);
                        }
                    }
                }
            }

            //Clear the buffer of collision pairs to turn off and pool
            while (InactiveCollisionPairs.Count > 0)
            {
                var instancePair = InactiveCollisionPairs.Peek();
                var pair         = instancePair.Pair;

                if (pair.Active)
                {
                    //It's active again! Get it out of inactives and move on to the next guy.
                    InactiveCollisionPairs.Remove();
                }

                var passedFrames = LockstepManager.FrameCount - pair.LastFrame;
                if (passedFrames >= inactiveFrameThreshold)
                {
                    InactiveCollisionPairs.Remove();
                    FullDeactivateCollisionPair(pair);
                }
                else
                {
                    break;
                }
            }

            for (int i = 0; i < DynamicSimObjects.PeakCount; i++)
            {
                LSBody b1 = DynamicSimObjects.innerArray[i];
                if (b1.IsNotNull())
                {
                    b1.Simulate();
                }
            }
            ResetAccumulation = true;
        }
Exemplo n.º 6
0
 public void RemoveBuff(Buff buff)
 {
     Buffs.RemoveAt(buff.ID);
 }
Exemplo n.º 7
0
 internal void RemoveBuff(Buff buff)
 {
     Buffs.RemoveAt(buff.ID);
 }
 public static void RemoveNode(int id)
 {
     ActivatedNodes.RemoveAt(id);
 }
Exemplo n.º 9
0
 public static void Dessimilate(Cover cover)
 {
     Covers.RemoveAt(cover.ID);
     cover.Version--;
 }
Exemplo n.º 10
0
 public void Unboard(int passengerID)
 {
     Passengers.RemoveAt(passengerID);
 }