public TrainerComponent(IntPtr ptr) : base(ptr)
        {
            log = BepInExLoader.log;
            //log.LogMessage("TrainerComponent Loaded");

            instance = this;
        }
        public static void DumpGameObject(this GameObject obj)
        {
            if (obj == null)
            {
                return;
            }

            Il2CppSystem.Collections.Generic.List <GameObject> tmpList = new Il2CppSystem.Collections.Generic.List <GameObject>();
            tmpList.Add(obj);
            TrainerComponent.DumpAll(tmpList);
        }
        internal static GameObject Create(string name)
        {
            obj = new GameObject(name);
            DontDestroyOnLoad(obj);

            var component = new TrainerComponent(obj.AddComponent(UnhollowerRuntimeLib.Il2CppType.Of <TrainerComponent>()).Pointer);

            toolTipComp         = new TooltipGUI(obj.AddComponent(UnhollowerRuntimeLib.Il2CppType.Of <TooltipGUI>()).Pointer);
            toolTipComp.enabled = false;

            return(obj);
        }
예제 #4
0
        public static void Update()
        {
            //BepInExLoader.log.LogMessage("Bootstrapper Update() Fired!");

            if (trainer == null)
            {
                BepInExLoader.log.LogMessage(" ");
                BepInExLoader.log.LogMessage("Bootstrapping Trainer...");
                try
                {
                    trainer = TrainerComponent.Create("TrainerComponentGO");
                    if (trainer != null)
                    {
                        BepInExLoader.log.LogMessage("Trainer Bootstrapped!"); BepInExLoader.log.LogMessage(" ");
                    }
                }
                catch (Exception e)
                {
                    BepInExLoader.log.LogMessage("ERROR Bootstrapping Trainer: " + e.Message);
                    BepInExLoader.log.LogMessage(" ");
                }
            }
        }