Exemple #1
0
        void StartEditingNewEnum()
        {
            currentEnumFileDetails = null;
            currentEnum            = new EnumCreator.EnumDefinition();

            if (_list == null)
            {
                return;
            }
            if (currentEnum == null)
            {
                return;
            }

            currentEnum.UpdateFilePath();

            string currentFilePath = currentEnum.filePath;
        }
        void StartEditingNewEnum()
        {
            Debug.Log("start New Enum: ");
            allowReordering        = true;
            currentEnumFileDetails = null;
            currentEnum            = new EnumCreator.EnumDefinition();

            if (_list == null)
            {
                return;
            }
            if (currentEnum == null)
            {
                return;
            }

            currentEnum.UpdateFilePath();

            //	string currentFilePath = currentEnum.filePath;
        }
Exemple #3
0
        void StartEditingExistingEnum(EnumFileDetails enumDetails)
        {
            allowReordering = false;
            //Debug.Log("startEditing: "+enumDetails.enumName);
            //Debug.Log(enumDetails);

            _sourceDetails = enumDetails;

            currentEnum = new EnumCreator.EnumDefinition();
            list        = null;

            currentEnumFileDetails = enumDetails;

            // nameSpace
            currentEnum.NameSpace = enumDetails.nameSpace;

            currentEnum.Name = enumDetails.enumName;

            Type _type = System.Type.GetType(currentEnum.NameSpace + "." + currentEnum.Name + ", Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null");

            currentEnum.entries = new List <string>();

            FieldInfo[] fields = _type.GetFields();

            foreach (var field in fields)
            {
                if (field.Name.Equals("value__"))
                {
                    continue;
                }

                currentEnum.entries.Add(field.Name);
                //Debug.Log(field.Name + ":" + field.GetRawConstantValue());
            }

            Repaint();
            ReBuildPreview = true;
            GUI.FocusControl(_unfocusControlName);
        }