Example #1
0
        /// <summary>
        /// Description : Display Enum Value
        /// </summary>
        private void DisplayEnum()
        {
            EditorGUILayout.BeginVertical();
            EditorGUILayout.Space(10);

            if (_manager._keyType == keyType.INT)
            {
                EditorGUILayout.LabelField("Int Value");
                EditorGUILayout.Space(5);

                _enumIndex.intValue = EditorGUILayout.IntField(_manager._enumIndex);

                _manager._enumIndex = _enumIndex.intValue;

                _manager.LoadColor();
            }
            else if (_manager._keyType == keyType.ENUM)
            {
                EditorGUILayout.LabelField("Enum Value");
                EditorGUILayout.Space(5);

                _enumChoice.stringValue = _manager.GetEnumName();

                if (_enumChoice.stringValue != "")
                {
                    _enumChoices = _manager._enumLibrary.GetEnumKeys(_enumChoice.stringValue);

                    _enumIndex.intValue = EditorGUILayout.Popup(_manager._enumIndex, _enumChoices.ToArray());

                    _manager._enumIndex = _enumIndex.intValue;

                    // Set enum string value
                    _manager._enumChoice = _enumChoices[_enumIndex.intValue];

                    _manager.LoadColor();
                }
                else
                {
                    EditorGUILayout.LabelField("Color Library doesnt have an enum");
                }
            }

            EditorGUILayout.EndVertical();

            EditorGUILayout.Space(5);
        }