public void SetFrameData(uint simulationFrame, ZombieInstance.Frame data) { this.m_lastFrame = (byte)(simulationFrame >> 4 & 3u); switch (this.m_lastFrame) { case 0: this.m_frame0 = data; return; case 1: this.m_frame1 = data; return; case 2: this.m_frame2 = data; return; case 3: this.m_frame3 = data; return; default: return; } }
public virtual void SimulationStep(ushort instanceID, ref ZombieInstance data, Vector3 physicsLodRefPos) { Logger.LogClassAndMethodName(this.GetType().Name, System.Reflection.MethodBase.GetCurrentMethod().Name); Logger.Log("2"); if ((data.m_flags & ZombieInstance.Flags.Character) != ZombieInstance.Flags.None) { Logger.Log(data.m_flags.ToString()); ZombieInstance.Frame lastFrameData = data.GetLastFrameData(); int num = Mathf.Clamp((int)(lastFrameData.m_position.x / 8f + 1080f), 0, 2159); int num2 = Mathf.Clamp((int)(lastFrameData.m_position.z / 8f + 1080f), 0, 2159); bool lodPhysics = Vector3.SqrMagnitude(physicsLodRefPos - lastFrameData.m_position) >= 62500f; this.SimulationStep(instanceID, ref data, ref lastFrameData, lodPhysics); int num3 = Mathf.Clamp((int)(lastFrameData.m_position.x / 8f + 1080f), 0, 2159); int num4 = Mathf.Clamp((int)(lastFrameData.m_position.z / 8f + 1080f), 0, 2159); if ((num3 != num || num4 != num2) && (data.m_flags & ZombieInstance.Flags.Character) != ZombieInstance.Flags.None) { Singleton <ZombieManager> .instance.RemoveFromGrid(instanceID, ref data, num, num2); Singleton <ZombieManager> .instance.AddToGrid(instanceID, ref data, num3, num4); } if (data.m_flags != ZombieInstance.Flags.None) { data.SetFrameData(Singleton <SimulationManager> .instance.m_currentFrameIndex, lastFrameData); } } }
public void RemoveFromGrid(ushort instance, ref ZombieInstance data) { ZombieInstance.Frame lastFrameData = data.GetLastFrameData(); int gridX = Mathf.Clamp((int)(lastFrameData.m_position.x / 8f + 1080f), 0, 2159); int gridZ = Mathf.Clamp((int)(lastFrameData.m_position.z / 8f + 1080f), 0, 2159); this.RemoveFromGrid(instance, ref data, gridX, gridZ); }
public virtual void SimulationStep(ushort instanceID, ref ZombieInstance citizenData, ref ZombieInstance.Frame frameData, bool lodPhysics) { Logger.LogClassAndMethodName(this.GetType().Name, System.Reflection.MethodBase.GetCurrentMethod().Name); Logger.Log("3"); }