public void Dispose()
 {
     // Reset all of the UI and GameSystems
     GameSystems.Shutdown();
     UiSystems.DisposeAll();
     Tig.Shutdown();
 }
Beispiel #2
0
    void OnTriggerEnter(Collider col)
    {
        if (col.gameObject.tag == "Player")
        {
            //销毁物体 增加收集数
            Tig.IncreaseCellCount();

            AudioSource.PlayClipAtPoint(pickUpSound, transform.position);
            Destroy(gameObject);
        }
    }
Beispiel #3
0
    public RealGameFiles()
    {
        _oldVfs = Tig.FS;
        var toeeDir = Environment.GetEnvironmentVariable("TOEE_DIR");

        if (toeeDir == null)
        {
            throw new NotSupportedException(
                      "Cannot run a test based on real data because TOEE_DIR environment variable is not set."
                      );
        }

        var dataFolder = Path.Join(TestData.SolutionDir, "Data");

        FS     = (TroikaVfs)Tig.CreateFileSystem(toeeDir, dataFolder);
        Tig.FS = FS;
    }
    private HeadlessGame(HeadlessGameOptions options)
    {
        var config = new GameConfig
        {
            InstallationFolder = options.InstallationFolder,
            SkipIntro          = true,
            SkipLegal          = true,
            // Debug UI makes no sense in the headless client
            EnableDebugUI = false,
            Rendering     =
            {
                DebugDevice = options.UseDebugRenderer
            }
        };
        var settings = new TigSettings
        {
            DataFolder   = options.OpenTempleDataPath ?? FindDataFolder(),
            OffScreen    = true,
            DisableSound = true
        };

        Globals.ConfigManager = new GameConfigManager(config);
        Globals.GameFolders   = new GameFolders(options.UserDataFolder);

        Tig.Startup(config, settings);

        GameSystems.InitializeFonts();
        GameSystems.InitializeSystems(new DummyLoadingProgress());

        GameSystems.GameInit.EnableStartMap = options.EnableStartMap; // Prevents shopmap from opening

        if (options.WithUserInterface)
        {
            Globals.UiManager          = new UiManager(Tig.MainWindow);
            Globals.UiAssets           = new UiAssets();
            Globals.UiStyles           = new UiStyles();
            Globals.WidgetButtonStyles = new WidgetButtonStyles();

            UiSystems.Startup(config);
        }

        GameSystems.LoadModule("ToEE", true);
    }