Пример #1
0
 public void Reset()
 {
     m_texture = null;
     m_depth   = 0;
     Checked   = false;
     m_hash    = 0;
 }
Пример #2
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);
            }
        }
Пример #3
0
        public GUITextureDraw(RenderTextureIdentifier rt, Vector4 rect, float depth)
        {
            m_texture = rt;
            m_rect    = rect;
            m_depth   = depth;

            m_hash = GetHash(rect, depth);
        }
Пример #4
0
        public void SetValue(RenderTextureIdentifier rt, Vector4 rect, float depth)
        {
            m_texture = rt;
            m_rect    = rect;
            m_depth   = depth;

            m_hash = GetHash(rect, depth);
        }
Пример #5
0
 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);
     }
 }
Пример #6
0
 public static void DrawTexture(Vector4 rect, RenderTextureIdentifier rt)
 {
     Context.AddTextureDrawCall(rt, rect, GUI.Depth);
     GUI.DepthIncrease();
 }
Пример #7
0
 public void AddTextureDrawCall(RenderTextureIdentifier rt, Vector4 rect, float depth)
 {
     m_texStorage.AddDraw(rt, rect, depth);
 }