Exemplo n.º 1
0
 private void DrawShaderProperties(ShaderProperties props)
 {
     this.m_ScrollViewShaderProps = GUILayout.BeginScrollView(this.m_ScrollViewShaderProps, new GUILayoutOption[0]);
     if (props.textures.Count <ShaderTextureInfo>() > 0)
     {
         GUILayout.Label("Textures", EditorStyles.boldLabel, new GUILayoutOption[0]);
         Rect nameRect;
         Rect flagsRect;
         Rect valueRect;
         this.GetPropertyFieldRects(props.textures.Count <ShaderTextureInfo>(), 16f, out nameRect, out flagsRect, out valueRect);
         ShaderTextureInfo[] textures = props.textures;
         for (int i = 0; i < textures.Length; i++)
         {
             ShaderTextureInfo t = textures[i];
             this.OnGUIShaderPropTexture(nameRect, flagsRect, valueRect, t);
             nameRect.y  += nameRect.height;
             flagsRect.y += flagsRect.height;
             valueRect.y += valueRect.height;
         }
     }
     if (props.floats.Count <ShaderFloatInfo>() > 0)
     {
         GUILayout.Label("Floats", EditorStyles.boldLabel, new GUILayoutOption[0]);
         Rect nameRect;
         Rect flagsRect;
         Rect valueRect;
         this.GetPropertyFieldRects(props.floats.Count <ShaderFloatInfo>(), 16f, out nameRect, out flagsRect, out valueRect);
         ShaderFloatInfo[] floats = props.floats;
         for (int j = 0; j < floats.Length; j++)
         {
             ShaderFloatInfo t2 = floats[j];
             this.OnGUIShaderPropFloat(nameRect, flagsRect, valueRect, t2);
             nameRect.y  += nameRect.height;
             flagsRect.y += flagsRect.height;
             valueRect.y += valueRect.height;
         }
     }
     if (props.vectors.Count <ShaderVectorInfo>() > 0)
     {
         GUILayout.Label("Vectors", EditorStyles.boldLabel, new GUILayoutOption[0]);
         Rect nameRect;
         Rect flagsRect;
         Rect valueRect;
         this.GetPropertyFieldRects(props.vectors.Count <ShaderVectorInfo>(), 16f, out nameRect, out flagsRect, out valueRect);
         ShaderVectorInfo[] vectors = props.vectors;
         for (int k = 0; k < vectors.Length; k++)
         {
             ShaderVectorInfo t3 = vectors[k];
             this.OnGUIShaderPropVector4(nameRect, flagsRect, valueRect, t3);
             nameRect.y  += nameRect.height;
             flagsRect.y += flagsRect.height;
             valueRect.y += valueRect.height;
         }
     }
     if (props.matrices.Count <ShaderMatrixInfo>() > 0)
     {
         GUILayout.Label("Matrices", EditorStyles.boldLabel, new GUILayoutOption[0]);
         Rect nameRect;
         Rect flagsRect;
         Rect valueRect;
         this.GetPropertyFieldRects(props.matrices.Count <ShaderMatrixInfo>(), 48f, out nameRect, out flagsRect, out valueRect);
         ShaderMatrixInfo[] matrices = props.matrices;
         for (int l = 0; l < matrices.Length; l++)
         {
             ShaderMatrixInfo t4 = matrices[l];
             this.OnGUIShaderPropMatrix(nameRect, flagsRect, valueRect, t4);
             nameRect.y  += nameRect.height;
             flagsRect.y += flagsRect.height;
             valueRect.y += valueRect.height;
         }
     }
     if (props.buffers.Count <ShaderBufferInfo>() > 0)
     {
         GUILayout.Label("Buffers", EditorStyles.boldLabel, new GUILayoutOption[0]);
         Rect nameRect;
         Rect flagsRect;
         Rect valueRect;
         this.GetPropertyFieldRects(props.buffers.Count <ShaderBufferInfo>(), 16f, out nameRect, out flagsRect, out valueRect);
         ShaderBufferInfo[] buffers = props.buffers;
         for (int m = 0; m < buffers.Length; m++)
         {
             ShaderBufferInfo t5 = buffers[m];
             this.OnGUIShaderPropBuffer(nameRect, flagsRect, valueRect, t5);
             nameRect.y  += nameRect.height;
             flagsRect.y += flagsRect.height;
             valueRect.y += valueRect.height;
         }
     }
     GUILayout.EndScrollView();
 }
Exemplo n.º 2
0
 private void OnGUIShaderPropVector4(Rect nameRect, Rect flagsRect, Rect valueRect, ShaderVectorInfo t)
 {
     GUI.Label(nameRect, t.name, EditorStyles.miniLabel);
     this.DrawShaderPropertyFlags(flagsRect, t.flags);
     GUI.Label(valueRect, t.value.ToString("g2"), EditorStyles.miniLabel);
     this.ShaderPropertyCopyValueMenu(valueRect, t.value);
 }