Пример #1
0
    static EditorInit()
    {
        var    p    = System.Diagnostics.Process.GetCurrentProcess();
        string pkey = string.Format("pid:{0}_{1}", p.Id, p.StartTime.ToString("yyyy-MM-dd_HH-mm-ss-fff"));

        s_HasKey = EditorPrefs.HasKey(pkey);
        if (!s_HasKey)
        {
            EditorPrefs.SetBool(pkey, true);
        }
        Debug.LogWarningFormat("process key {0}", pkey);
        EditorApplication.quitting += () => {
            EditorPrefs.DeleteKey(pkey);
            Debug.LogWarningFormat("delete key {0}", pkey);
        };
        s_ProcessKey = pkey;

        PlayerSettings.Android.keystorePass = "******";
        PlayerSettings.Android.keyaliasName = "qsmy.keystore";
        PlayerSettings.Android.keyaliasPass = "******";
        GlobalVariables.Instance.IsEditor   = true;

        LogSystem.OnOutput = (Log_Type type, string msg) => {
            if (type == Log_Type.LT_Error)
            {
                Debug.LogError(msg);
            }
            else if (type == Log_Type.LT_Warn)
            {
                Debug.LogWarning(msg);
            }
            else
            {
                Debug.Log(msg);
            }
        };

        if (ExecuteUpdate("editor_update_check.dsl"))
        {
            EditorApplication.Exit(0);
        }
        else
        {
            EditorApplication.update += Update;

            BuildPlayerWindow.RegisterGetBuildPlayerOptionsHandler(opt => {
                var newOpt      = BuildPlayerWindow.DefaultBuildMethods.GetBuildPlayerOptions(opt);
                newOpt.options &= (~BuildOptions.StrictMode);
                return(newOpt);
            });
        }
    }
Пример #2
0
    static GameDatabase()
    {
        BuildPlayerWindow.RegisterGetBuildPlayerOptionsHandler(HandleBuild);

        EditorApplication.playModeStateChanged += change =>
        {
            if (change == PlayModeStateChange.EnteredPlayMode)
            {
                var db = GameDatabase.Instance;
                foreach (var ep in db.episodes)
                {
                    ep.UpdateScenePath();
                }
            }
        };
    }
 static EditorBuildConfigs()
 {
     BuildPlayerWindow.RegisterBuildPlayerHandler(BuildPlayerHandler);
     BuildPlayerWindow.RegisterGetBuildPlayerOptionsHandler(BuildPlayerOptionsHandler);
 }
Пример #4
0
 static EditorAppConfig()
 {
     EditorApplication.delayCall += InitializeOnLoad;
     BuildPlayerWindow.RegisterBuildPlayerHandler(BuildPlayerHandler);
     BuildPlayerWindow.RegisterGetBuildPlayerOptionsHandler(BuildPlayerOptionsHandler);
 }