Exemplo n.º 1
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;
            }
        }