Beispiel #1
0
    private void DrawLights_Formal()
    {
        GUILayout.Space(10);
        scrollPos = GUILayout.BeginScrollView(scrollPos);

        for (int i = 0; i < lightNames_Formal.Length; i++)
        {
            string lightName = lightNames_Formal[i];

            oriBgColor          = GUI.backgroundColor;
            GUI.backgroundColor = lightName.Equals(lightApplied) ? Color.green : oriBgColor;
            GUILayout.BeginHorizontal(EditorStyles.helpBox);
            GUI.backgroundColor = oriBgColor;

            if (GUILayout.Button("预览", GUILayout.Width(60)))
            {
                PreviewLight(PBLighting.FormalPath, lightName);
            }
            if (GUILayout.Button("应用", GUILayout.Width(60)))
            {
                PBLightingLiteracy.SaveLocal(lightName);
                lightApplied = lightName;
            }
            GUILayout.Label(lightName, GUILayout.Width(200));
            GUILayout.EndHorizontal();
        }

        GUILayout.EndScrollView();
    }
Beispiel #2
0
    private void DrawLights_Beta()
    {
        GUILayout.Space(5);

        GUILayout.BeginHorizontal();
        GUILayout.Label("保存灯光", GUILayout.Width(50));
        lightNameSaved = GUILayout.TextField(lightNameSaved, 20, GUILayout.Width(150));
        if (GUILayout.Button("+", GUILayout.Width(80)))
        {
            SaveNewLight();
        }
        GUILayout.EndHorizontal();

        GUILayout.Space(5);
        scrollPos_Beta = GUILayout.BeginScrollView(scrollPos_Beta);

        for (int i = 0; i < lightNames_Beta.Length; i++)
        {
            string lightName = lightNames_Beta[i];

            oriBgColor          = GUI.backgroundColor;
            GUI.backgroundColor = lightName.Equals(lightApplied) ? Color.green : oriBgColor;
            GUILayout.BeginHorizontal(EditorStyles.helpBox);
            GUI.backgroundColor = oriBgColor;

            if (GUILayout.Button("-", GUILayout.Width(30)))
            {
                RemoveLight(lightName);
            }
            if (GUILayout.Button("预览", GUILayout.Width(60)))
            {
                PreviewLight(PBLighting.BetaPath, lightName);
            }
            if (GUILayout.Button("应用", GUILayout.Width(60)))
            {
                PBLightingLiteracy.SaveLocal(lightName);
                lightApplied = lightName;
            }
            GUILayout.Label(lightName, GUILayout.Width(200));
            GUILayout.EndHorizontal();
        }

        GUILayout.EndScrollView();
    }
Beispiel #3
0
 private void OnFocus()
 {
     UpdateLightNames();
     lightApplied = PBLightingLiteracy.ReadLocal();
 }