示例#1
0
 public void RemoveHealth(Health health)
 {
     shieldedHealths.RemoveAt(health.shieldIndex);
     health.OnTakeProjectile     -= OnTakeDamage;
     health.Agent.onDeactivation -= OnCoveredDie;
     health.Unprotect(this);
 }
示例#2
0
        public static void Pool(MovementGroup group)
        {
            int indexID = group.indexID;

            activeGroups.RemoveAt(indexID);
            pooledGroups.Add(group);
        }
示例#3
0
 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;
                 }
             }
         }
     }
 }
示例#6
0
 internal void RemoveBuff(Buff buff)
 {
     Buffs.RemoveAt(buff.ID);
 }
 public void Unboard(int passengerID)
 {
     Passengers.RemoveAt(passengerID);
 }
示例#8
0
 public static void RemoveNode(int id)
 {
     ActivatedNodes.RemoveAt(id);
 }
示例#9
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;
        }
        public static void LateSimulate()
        {
            //2 seconds before turning off
            int inactiveFrameThreshold = 0;

            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)
                    {
                        RanCollisionPairs.RemoveAt(i);
                        pair._ranIndex = -1;
                    }
                    else
                    {
                        if (pair.LastFrame == LockstepManager.FrameCount)
                        {
                        }
                        else if (pair._ranIndex >= 0)
                        {
#if false
                            if (!RanCollisionPairs.SafeRemoveAt(pair._ranIndex, instancePair))
                            {
                                Debug.Log("Removal Failed");
                            }
#else
                            RanCollisionPairs.RemoveAt(pair._ranIndex);
#endif

                            pair._ranIndex = -1;

                            InactiveCollisionPairs.Add(instancePair);
                        }
                    }
                }
            }

            while (InactiveCollisionPairs.Count > 0)
            {
                var instancePair = InactiveCollisionPairs.Peek();
                var pair         = instancePair.Pair;
                if (instancePair.Version != pair._Version)
                {
                    InactiveCollisionPairs.Remove();
                }
                else
                {
                    int dif = LockstepManager.FrameCount - pair.LastFrame;
                    if (dif == 0)
                    {
                        InactiveCollisionPairs.Remove();
                    }
                    else
                    {
                        if (dif >= inactiveFrameThreshold)
                        {
                            FullDeactivateCollisionPair(pair);
                            InactiveCollisionPairs.Remove();
                        }
                        else
                        {
                            break;
                        }
                    }
                }
            }
            for (int i = 0; i < DynamicSimObjects.PeakCount; i++)
            {
                LSBody b1 = DynamicSimObjects.innerArray[i];
                if (b1.IsNotNull())
                {
                    b1.Simulate();
                }
            }
        }
示例#11
0
 internal static void Dessimilate(LSTrigger trigger)
 {
     AssimilatedTriggers.RemoveAt(trigger.ID);
 }