Пример #1
0
        public override void Start()
        {
            try
            {
                GungeonAPI.Init();
                KeyShrine.Add();

                //Enable the debug flow
                ETGModConsole.Commands.AddUnit("debugflow", (args) =>
                {
                    DungeonHandler.debugFlow = !DungeonHandler.debugFlow;
                    string status            = DungeonHandler.debugFlow ? "enabled" : "disabled";
                    string color             = DungeonHandler.debugFlow ? "00FF00" : "FF0000";
                    Tools.Print($"Debug flow {status}", color, true);
                });

                //This is useful for figuring out where you want your shrine to go in the breach
                ETGModConsole.Commands.AddUnit("getpos", (args) =>
                {
                    ETGModConsole.Log("Player position: " + GameManager.Instance.PrimaryPlayer.transform.position);
                    ETGModConsole.Log("Player center: " + GameManager.Instance.PrimaryPlayer.sprite.WorldCenter);
                });

                ETGModConsole.Commands.AddUnit("dissectshrine", (args) =>
                {
                    var c = GetClosestCustomShrineObject();
                    Tools.BreakdownComponents(c);
                    Tools.LogPropertiesAndFields(c.GetComponent <SimpleInteractable>());
                });

                ETGModConsole.Commands.AddUnit("roomname", (args) =>
                {
                    var room = GameManager.Instance.PrimaryPlayer.CurrentRoom;
                    Tools.Print(room.GetRoomName());
                });

                ETGModConsole.Commands.AddUnit("hidehitboxes", (args) => HitboxMonitor.DeleteHitboxDisplays());
                ETGModConsole.Commands.AddUnit("showhitboxes", (args) =>
                {
                    foreach (var obj in GameObject.FindObjectsOfType <SpeculativeRigidbody>())
                    {
                        if (obj && obj.sprite && Vector2.Distance(obj.sprite.WorldCenter, GameManager.Instance.PrimaryPlayer.sprite.WorldCenter) < 8)
                        {
                            Tools.Log(obj?.name);
                            HitboxMonitor.DisplayHitbox(obj);
                        }
                    }
                });

                Tools.Print($"Custom Rooms {VERSION} loaded.", "FF00FF", true);
            }
            catch (Exception e)
            {
                Tools.Print("Failed to load Custom Rooms Mod", "FF0000", true);
                Tools.PrintException(e);
            }
        }
Пример #2
0
        // Token: 0x06000019 RID: 25 RVA: 0x000036B8 File Offset: 0x000018B8
        public static void DisplayHitbox(SpeculativeRigidbody speculativeRigidbody)
        {
            PixelCollider hitboxPixelCollider = speculativeRigidbody.HitboxPixelCollider;

            Tools.Log <string>("Collider Found...");
            bool flag = !speculativeRigidbody.gameObject.GetComponent <HitboxMonitor.HitBoxDisplay>();

            if (flag)
            {
                speculativeRigidbody.gameObject.AddComponent <HitboxMonitor.HitBoxDisplay>();
            }
            Tools.Log <string>("Displaying...");
            HitboxMonitor.LogHitboxInfo(hitboxPixelCollider);
        }