示例#1
0
        public static void Postfix(PlayerManager __instance, ref string __result)
        {
            if (Input.GetKey(KeyCode.P))
            {
                __result += "\nposition = " + FormatHelper.FormatVector(__instance.m_InteractiveObjectUnderCrosshair.transform.position);
                return;
            }

            if (Input.GetKey(KeyCode.R))
            {
                __result += "\nrotation = " + FormatHelper.FormatVector(__instance.m_InteractiveObjectUnderCrosshair.transform.rotation.eulerAngles);
                return;
            }

            if (Input.GetKey(KeyCode.L))
            {
                __result += "\nscene = " + GameManager.m_ActiveScene;
                return;
            }

            if (Input.GetKey(KeyCode.K))
            {
                Container container = __instance.m_InteractiveObjectUnderCrosshair.GetComponentInChildren <Container>();
                if (container != null)
                {
                    __result += "\nloottable = " + LootTableHelper.GetLootTableName(container);
                }
                return;
            }
        }
示例#2
0
        public static void Postfix()
        {
            if (!Input.GetKey(KeyCode.RightControl) && !Input.GetKey(KeyCode.LeftControl))
            {
                return;
            }

            if (Input.GetKeyDown(KeyCode.P) || Input.GetKeyDown(KeyCode.R))
            {
                GameObject gameObject = GameManager.GetPlayerManagerComponent().m_InteractiveObjectNearCrosshair;
                if (gameObject == null)
                {
                    return;
                }

                var line = "item=" + gameObject.name + " p=" + FormatHelper.FormatVector(gameObject.transform.position) + " r=" + FormatHelper.FormatVector(gameObject.transform.rotation.eulerAngles) + " c=100";
                Debug.Log(line);
                CopyToClipboard(line, "Item Definition");
                return;
            }

            if (Input.GetKeyDown(KeyCode.L))
            {
                var line = "scene=" + GameManager.m_ActiveScene;
                Debug.Log(line);
                CopyToClipboard(line, "Scene Definition");
                return;
            }

            if (Input.GetKeyDown(KeyCode.K))
            {
                GameObject gameObject = GameManager.GetPlayerManagerComponent().m_InteractiveObjectNearCrosshair;
                if (gameObject == null)
                {
                    return;
                }

                Container container = gameObject.GetComponentInChildren <Container>();
                if (container == null)
                {
                    return;
                }

                var line = "loottable=" + LootTableHelper.GetLootTableName(container);
                Debug.Log(line);
                CopyToClipboard(line, "LootTable Definition");
                return;
            }
        }
示例#3
0
        private static void SaveInformation(bool saveToFile)
        {
            string line;

            switch (KeyTracker.currentMode)
            {
            case GrabberMode.None:
                return;

            case GrabberMode.Scene:
                line = "scene=" + GameManager.m_ActiveScene;
                RecordData(line, "Scene Definition", saveToFile);
                return;

            case GrabberMode.LootTable:
                GameObject gameObject1 = GameManager.GetPlayerManagerComponent()?.m_InteractiveObjectNearCrosshair;

                if (gameObject1 is null)
                {
                    return;
                }

                Container container = gameObject1.GetComponentInChildren <Container>();
                if (container is null)
                {
                    return;
                }

                line = "loottable=" + LootTableHelper.GetLootTableName(container);
                RecordData(line, "LootTable Definition", saveToFile);
                return;

            default:                     //Name, Position, or Rotation
                GameObject gameObject2 = GameManager.GetPlayerManagerComponent().m_InteractiveObjectNearCrosshair;
                if (gameObject2 is null)
                {
                    return;
                }

                line = "item=" + gameObject2.name + " p=" + FormatHelper.FormatVector(gameObject2.transform.position) + " r=" + FormatHelper.FormatVector(gameObject2.transform.rotation.eulerAngles) + " c=100";
                RecordData(line, "Item Definition", saveToFile);
                return;
            }
        }
示例#4
0
        public static void Postfix(PlayerManager __instance, ref string __result)
        {
            if (__instance?.m_InteractiveObjectUnderCrosshair?.name is null)
            {
                return;
            }
            if (__result is null || string.IsNullOrWhiteSpace(GameManager.m_ActiveScene))
            {
                return;
            }
            switch (KeyTracker.currentMode)
            {
            case GrabberMode.Name:
                __result += "\nname = " + __instance.m_InteractiveObjectUnderCrosshair.name;
                break;

            case GrabberMode.Position:
                __result += "\nposition = " + FormatHelper.FormatVector(__instance.m_InteractiveObjectUnderCrosshair.transform.position);
                break;

            case GrabberMode.Rotation:
                __result += "\nrotation = " + FormatHelper.FormatVector(__instance.m_InteractiveObjectUnderCrosshair.transform.rotation.eulerAngles);
                break;

            case GrabberMode.Scene:
                __result += "\nscene = " + GameManager.m_ActiveScene;
                break;

            case GrabberMode.LootTable:
                Container container = __instance.m_InteractiveObjectUnderCrosshair.GetComponentInChildren <Container>();
                if (container != null)
                {
                    __result += "\nloottable = " + LootTableHelper.GetLootTableName(container);
                }
                break;
            }
            if (Settings.options.useDeleteFunction && CustomInput.GetKeyDown(Settings.options.deleteKey))
            {
                UnityEngine.Object.Destroy(__instance.m_InteractiveObjectUnderCrosshair);
            }
        }