Beispiel #1
0
 void Update()
 {
     try
     {
         if (Input.GetKeyUp(KeyCode.BackQuote) &&
             (Input.GetKey(KeyCode.LeftShift) ||
              Input.GetKey(KeyCode.RightShift)))
         {
             if (urepl == null)
             {
                 Init();
                 Game.Instance.Keyboard.Disabled.SetValue(true);
                 DisableCamera();
                 return;
             }
             var window = urepl.GetComponent <Window>();
             if (window.isOpen)
             {
                 Game.Instance.Keyboard.Disabled.SetValue(false);
                 EnableCamera();
                 window.Close();
             }
             else
             {
                 Game.Instance.Keyboard.Disabled.SetValue(true);
                 DisableCamera();
                 window.Open();
             }
         }
     } catch (Exception ex)
     {
         ModMain.DebugLog(ex.ToString() + "\n" + ex.StackTrace);
     }
 }
Beispiel #2
0
 void Init()
 {
     if (urepl == null)
     {
         AssetHelper.bundlePath = "Mods/KingmakerREPL/AssetBundles/urepl";
         var prefab = AssetHelper.Load <GameObject>("uREPL/Prefabs/uREPL.prefab");
         urepl = UnityEngine.Object.Instantiate <GameObject>(prefab);
         var window = urepl.GetComponent <uREPL.Window>();
         var main   = urepl.GetComponent <uREPL.Main>();
         if (main.parameters == null)
         {
             ModMain.DebugLog("Error Deserializing, missing parameters");
             main.parameters = new Parameters();
         }
         if (main.editor == null)
         {
             ModMain.DebugLog("Error Deserializing, missing editor");
             main.editor = new EditorParameters();
         }
         uREPL.Mono.Run("using Kingmaker;");
         return;
     }
 }