Exemple #1
0
 public EcsPreProcessor(EcsConfig config, string filePath)
 {
     Config   = config;
     FilePath = filePath;
     CreateTagsDictionary();
     EcsCustomDefinitions.ProcessPreProcessor(this);
 }
        /// <summary>
        /// Creates a new C# script
        /// </summary>
        /// <param name="templateName"></param>
        public static void CreateScript(string templateName)
        {
            var path = Path.Combine(EcsCore.GetCurrentFolderPath(), "Untitled.txt");

            var endAction = CreateInstance <CreateScriptEndAction>();
            var config    = EcsConfig.GetActiveConfig();
            var template  = GetScriptTemplate(templateName);

            endAction.LoadDependencies(config, template);

            ProjectWindowUtil.StartNameEditingIfProjectWindowExists(
                0,
                endAction,
                path,
                EditorGUIUtility.IconContent("cs Script Icon").image as Texture2D,
                null);
        }
 private static void CreateConfig()
 {
     EcsScriptTemplate.CreateDefaultTemplates();
     EcsConfig.Create();
 }
Exemple #4
0
 public void LoadDependencies(EcsConfig config, EcsScriptTemplate template)
 {
     _config   = config;
     _template = template;
 }