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(); }
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; } }
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; } } } } }
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; }
public void RemoveBuff(Buff buff) { Buffs.RemoveAt(buff.ID); }
internal void RemoveBuff(Buff buff) { Buffs.RemoveAt(buff.ID); }
public static void RemoveNode(int id) { ActivatedNodes.RemoveAt(id); }
public static void Dessimilate(Cover cover) { Covers.RemoveAt(cover.ID); cover.Version--; }
public void Unboard(int passengerID) { Passengers.RemoveAt(passengerID); }