public void Release() { lock (m_Lock) { if (m_MaskTexture != null) { m_MaskTexture.Release(); } m_MaskTexture = null; m_MapData = null; m_SortAngle = null; if (m_Queue != null) { m_Queue.Clear(); } if (m_RayCastQueue != null) { m_RayCastQueue.Clear(); } if (m_Arrives != null) { m_Arrives.Clear(); } m_Queue = null; m_RayCastQueue = null; m_Arrives = null; m_FOVCalculator = null; } m_Lock = null; }
public void Release() { lock (m_Lock) { if (m_MaskTexture != null) { m_MaskTexture.Release(); } m_MaskTexture = null; m_MapData = null; m_CalculaterBase.Release(); m_CalculaterBase = null; m_FOVCalculator = null; } m_Lock = null; }
public FOWMap(Vector3 begionPosition, float xSize, float zSize, int texWidth, int texHeight, float heightRange) { m_FOVCalculator = new WaitCallback(this.CalculateFOV); m_MapData = new byte[texWidth, texHeight]; m_MaskTexture = new FOWMaskTexture(texWidth, texHeight); m_DeltaX = xSize / texWidth; m_DeltaZ = zSize / texHeight; m_BeginPosition = begionPosition; m_TexWidth = texWidth; m_TexHdight = texHeight; GenerateMapData(heightRange); m_Lock = new object(); }
// private object m_Lock; public FOWMap(FogOfWarEffect.FogMaskType fogMaskType, Vector3 begionPosition, float xSize, float zSize, int texWidth, int texHeight, float heightRange) { // m_FOVCalculator = new WaitCallback(this.CalculateFOV); //m_MapData = new FOWMapData(texWidth, texHeight);//new byte[texWidth, texHeight]; m_MaskTexture = new FOWMaskTexture(texWidth, texHeight); m_DeltaX = xSize / texWidth; m_DeltaZ = zSize / texHeight; m_InvDeltaX = 1.0f / m_DeltaX; m_InvDeltaZ = 1.0f / m_DeltaZ; m_BeginPosition = begionPosition; m_TexWidth = texWidth; m_TexHdight = texHeight; m_CalculaterBase = CreateCalculator(fogMaskType); //GenerateMapData(heightRange); // m_Lock = new object(); }