protected void DrawMaterials()
 {
     GUILayout.BeginHorizontal();
     materialID = GUILayout.SelectionGrid(materialID, materialList, 2, GUIResources.GetStyle("radio_text_button"));
     if (materialID != savedID)
     {
         savedID = materialID;
         matl    = model.materials[savedID];
         InitializeShaderProperties(model.materials[savedID].materials[0]);
     }
     GUILayout.EndHorizontal();
 }
        public UIMaterialEditWindow(WaterfallModel modelToEdit, bool show) : base(show)
        {
            model = modelToEdit;
            Utils.Log($"[UIMaterialEditWindow]: Started editing materials on {modelToEdit.ToString()}");

            materialList = new string[model.materials.Count];
            for (int i = 0; i < model.materials.Count; i++)
            {
                materialList[i] = $"{model.materials[i].transformName} ({model.materials[i].materials[0].name.Split('(').First()})";
            }
            matl = modelToEdit.materials[materialID];


            InitializeShaderProperties(matl.materials[0]);
            WindowPosition = new Rect(Screen.width / 2 - 200, Screen.height / 2f, 400, 100);
        }
        public void ChangeMaterial(WaterfallModel modelToEdit)
        {
            model = modelToEdit;
            Utils.Log($"[UIMaterialEditWindow]: Started editing materials on {modelToEdit.ToString()}", LogType.UI);
            materialID   = 0;
            materialList = new string[model.materials.Count];
            for (int i = 0; i < model.materials.Count; i++)
            {
                materialList[i] = model.materials[i].materials[0].name;
            }
            matl       = modelToEdit.materials[materialID];
            showWindow = true;

            InitializeShaderProperties(matl.materials[0]);

            WindowPosition = new Rect(Screen.width / 2 - 200, Screen.height / 2f, 400, 100);
        }