GetProceduralFloat() private method

private GetProceduralFloat ( string inputName ) : float
inputName string
return float
コード例 #1
0
 static public int GetProceduralFloat(IntPtr l)
 {
     try{
         UnityEngine.ProceduralMaterial self = (UnityEngine.ProceduralMaterial)checkSelf(l);
         System.String a1;
         checkType(l, 2, out a1);
         System.Single ret = self.GetProceduralFloat(a1);
         pushValue(l, ret);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
 static public int GetProceduralFloat(IntPtr l)
 {
     try {
         UnityEngine.ProceduralMaterial self = (UnityEngine.ProceduralMaterial)checkSelf(l);
         System.String a1;
         checkType(l, 2, out a1);
         var ret = self.GetProceduralFloat(a1);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #3
0
ファイル: GUI_Script.cs プロジェクト: pmpu/3DRecreator
    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();
    }