static public int RebuildTextures(IntPtr l) { try { UnityEngine.ProceduralMaterial self = (UnityEngine.ProceduralMaterial)checkSelf(l); self.RebuildTextures(); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int RebuildTextures(IntPtr l) { try { UnityEngine.ProceduralMaterial self = (UnityEngine.ProceduralMaterial)checkSelf(l); self.RebuildTextures(); return(0); } catch (Exception e) { LuaDLL.luaL_error(l, e.ToString()); return(0); } }
protected void InputOptions(ProceduralMaterial material) { EditorGUI.BeginChangeCheck(); this.InputsGUI(); if (EditorGUI.EndChangeCheck()) { material.RebuildTextures(); } }
void OnGUI() { GUILayout.BeginArea(new Rect(10, 10, Screen.width / 6, Screen.height - 20)); scrollViewVector = GUILayout.BeginScrollView(scrollViewVector); //scrollViewVector = GUI.BeginScrollView(new Rect(10, 10, Screen.width / 6, Screen.height - 20), scrollViewVector, new Rect(10, 10, Screen.width / 6, Screen.height*5)); string[] bn = new string[buttonNames.Count()]; for (int i = 0; i < buttonNames.Count(); i++) { bn[i] = buttonNames[i]; } button_selected = GUILayout.SelectionGrid(button_selected, bn, 1); GUILayout.EndScrollView(); GUILayout.EndArea(); //mt = Materials[button_selected]; GUILayout.BeginArea(new Rect(Screen.width - (Screen.width / 6), 10, Screen.width / 6, Screen.height - 20)); Object.GetComponent<Renderer>().sharedMaterial = Materials[button_selected]; mt_proc = Object.GetComponent<Renderer>().sharedMaterial as ProceduralMaterial; //material_arguments.Clear(); material_arguments = new List<ProceduralPropertyDescription>(); material_arguments = mt_proc.GetProceduralPropertyDescriptions().Select(m => { return m; }).ToList(); //prop_values = new float[material_arguments.Count()]; //this.prop_values = new List<float>(); //int ind = 0; GUILayout.BeginScrollView(Vector2.zero); foreach (ProceduralPropertyDescription desc in material_arguments) { Debug.Log(desc.GetType()); if (desc.type == ProceduralPropertyType.Float) { //prop_values[ind] = GUILayout.HorizontalSlider(prop_values[ind], desc.minimum, desc.maximum); GUILayout.TextField(desc.name); mt_proc.SetProceduralFloat(desc.name, GUILayout.HorizontalSlider(mt_proc.GetProceduralFloat(desc.name), desc.minimum, desc.maximum)); //ind++; } //else Debug.Log("There is no float"); } GUILayout.EndScrollView(); //foreach (var m in mt_proc.GetProceduralPropertyDescriptions()) { material_arguments.Add(m); Debug.Log(m.name); } //arg.Clear(); //arg = new List<float>(); //argument = GUILayout.HorizontalSlider(argument, 0, 1); //arg.Add(argument); //mt_proc.SetProceduralFloat("Age", argument); mt_proc.RebuildTextures(); // Object.GetComponent<Renderer>().sharedMaterial = mt_proc; GUILayout.EndArea(); }