Пример #1
0
        public override void OnInspectorGUI()
        {
            // Create labels and fields for inputing of properties

            EditorGUILayout.PropertyField(isDarkTheme);

            EditorGUILayout.LabelField("Color Palette");

            EditorGUI.indentLevel++;

            EditorGUILayout.PropertyField(accentColor);

            EditorGUILayout.LabelField("Button State Colors");

            EditorGUI.indentLevel++;

            EditorGUILayout.PropertyField(hoverColor);

            EditorGUILayout.PropertyField(pressedColor);

            EditorGUILayout.PropertyField(disabledColor);

            // Apply input properties and call script to update colors

            serializedObject.ApplyModifiedProperties();

            VRUIColorPalette colorPalette = (VRUIColorPalette)target;

            colorPalette.UpdateColors();
        }
Пример #2
0
        void Awake()
        {
            // Update colors on wakeup

            if (instance != null && instance != this)
            {
                Destroy(this.gameObject);
            }
            else
            {
                instance = this;
            }

            UpdateColors();
        }