public void Reset() { m_texture = null; m_depth = 0; Checked = false; m_hash = 0; }
public void AddDraw(RenderTextureIdentifier identifier, Vector4 rect, float depth) { if (m_textureStorage.ContainsKey(identifier)) { long nhash = GUITextureDraw.GetHash(rect, depth); var drawlist = m_textureStorage[identifier]; foreach (var draw in drawlist) { if (draw.Hash == nhash) { draw.Checked = true; return; } } var newdraw = GetNewGUITextureDraw(identifier, rect, depth); newdraw.Checked = true; drawlist.Add(newdraw); m_changed = true; } else { m_changed = true; var drawlist = new List <GUITextureDraw>(); var newdraw = GetNewGUITextureDraw(identifier, rect, depth); newdraw.Checked = true; drawlist.Add(newdraw); m_textureStorage.Add(identifier, drawlist); } }
public GUITextureDraw(RenderTextureIdentifier rt, Vector4 rect, float depth) { m_texture = rt; m_rect = rect; m_depth = depth; m_hash = GetHash(rect, depth); }
public void SetValue(RenderTextureIdentifier rt, Vector4 rect, float depth) { m_texture = rt; m_rect = rect; m_depth = depth; m_hash = GetHash(rect, depth); }
private GUITextureDraw GetNewGUITextureDraw(RenderTextureIdentifier rt, Vector4 rect, float depth) { if (m_objpool.Count == 0) { return(new GUITextureDraw(rt, rect, depth)); } else { var draw = m_objpool.Pop(); draw.SetValue(rt, rect, depth); return(draw); } }
public static void DrawTexture(Vector4 rect, RenderTextureIdentifier rt) { Context.AddTextureDrawCall(rt, rect, GUI.Depth); GUI.DepthIncrease(); }
public void AddTextureDrawCall(RenderTextureIdentifier rt, Vector4 rect, float depth) { m_texStorage.AddDraw(rt, rect, depth); }