Пример #1
0
        /// <summary>
        /// Create a new script featuring the new enum.
        /// </summary>
        public void CreateEnum(EnumDefinition enumDefinition)
        {
            BuildScriptLiteral(enumDefinition);

            enumDefinition.UpdateFilePath();

            // Ensure that this path actually exists.
            if (!Directory.Exists(enumDefinition.directoryPath))
            {
                Directory.CreateDirectory(enumDefinition.directoryPath);
            }

            File.WriteAllText(enumDefinition.filePath, enumDefinition.ScriptLiteral);

            AssetDatabase.Refresh();
        }