Exemple #1
0
 //[MenuItem("Custom/执行Main")]
 static void DoMain()
 {
     if (_client == null)
     {
         var es = GameObject.Find("EventSystem");
         _client = es.GetComponent <EditorMain>();
         if (_client == null)
         {
             _client = es.AddComponent <EditorMain>();
         }
         _client.init();
     }
     else
     {
         _client.reload();
     }
     try
     {
         _client.test();
     }
     catch (Exception ex)
     {
         ZFDebug.Error(ex.ToString());
     }
 }
Exemple #2
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(this);
        }

        SettingsManager.SettingsChanged.AddListener(ApplySettings);
        mapStopwatch = new Stopwatch();
        ApplySettings();

        // create rp
        if (SettingsManager.Settings.DiscordRP)
        {
            gameObject.GetComponent <RichPresenceComponent>().enabled = true;
        }
        else
        {
            Destroy(gameObject.GetComponent <RichPresenceComponent>()); // delete rp if disabled
        }
    }
Exemple #3
0
 //[MenuItem("Custom/清空lua")]
 static void ClearLuaState()
 {
     if (_client != null)
     {
         _client.Destroy();
         _client = null;
     }
 }