Ejemplo n.º 1
0
        static void EditorEnvInit()
        {
            _fileInitializers.Clear();
            UnityEngine.Debug.Log("FrameworkPath   right?   " + frameworkPath);
            Framework.CreateEnv("IFramework_Editor", envType).InitWithAttribute();
            assemblyCompilationStarted += (str) => {
                Framework.env0.Dispose();
                UnityEngine.Debug.Log("EditorEnv Dispose");
            };

            update += Framework.env0.Update;
            Framework.env0.modules.Coroutine = Framework.env0.modules.CreateModule <CoroutineModule>();
#if UNITY_2018_1_OR_NEWER
            PlayerSettings.allowUnsafeCode = true;
#else
            string path    = Application.dataPath.CombinePath("mcs.rsp");
            string content = "-unsafe";
            if (File.Exists(path) && path.ReadText(System.Text.Encoding.Default) == content)
            {
                return;
            }
            path.WriteText(content, System.Text.Encoding.Default);
            AssetDatabase.Refresh();
            EditorUtil.ReOpen2();
#endif
            new ProjectFloderInitializer().Subscribe();
            _fileInitializers.ForEach(f => { f.Create(); });

            //if (!EditorApplication.isUpdating)
            //    AssetDatabase.Refresh();
        }
Ejemplo n.º 2
0
        static void EditorEnvInit()
        {
            UnityEngine.Debug.Log("IFramework: Root Path right?   " + frameworkPath);
            Framework.CreateEnv("IFramework_Editor", envType).InitWithAttribute();
            assemblyCompilationStarted += (str) => {
                Framework.env0.Dispose();
                UnityEngine.Debug.Log("IFramework: EditorEnv Dispose");
            };

            update += Framework.env0.Update;
#if UNITY_2018_1_OR_NEWER
            PlayerSettings.allowUnsafeCode = true;
#else
            string path    = UnityEngine.Application.dataPath.CombinePath("mcs.rsp");
            string content = "-unsafe";
            if (File.Exists(path) && path.ReadText(System.Text.Encoding.Default) == content)
            {
                return;
            }
            path.WriteText(content, System.Text.Encoding.Default);
            AssetDatabase.Refresh();
            EditorTools.Quit();
#endif
            typeof(IFileInitializer).GetSubTypesInAssemblys().ForEach((type) =>
            {
                if (!type.IsAbstract)
                {
                    (Activator.CreateInstance(type) as IFileInitializer).Create();
                }
            });
            delayCall += () => { AssetDatabase.Refresh(); };
        }
Ejemplo n.º 3
0
 private void Awake()
 {
     DontDestroyOnLoad(this.gameObject);
     instance = this;
     Framework.CreateEnv("Game_RT", envType).InitWithAttribute();
     game.CreateModules();
     game.Startup();
 }