コード例 #1
0
    void Start()
    {
        GameAPI.ResetGameAPI();

        bgMusic = GetComponent <AudioSource>();

        mainCamera = GameObject.Find("Main Camera")?.transform;

        if (PlayerPrefs.HasKey("gamePath"))
        {
            Debug.Log("Game path was detected: " + PlayerPrefs.GetString("gamePath"));

            if (!GameAPI.instance.SetGamePath(PlayerPrefs.GetString("gamePath")))
            {
                PathSelectionMenu();
            }
            else
            {
                SetupDefaultBackground();
            }
        }
        else
        {
            PathSelectionMenu();
        }

        CommandTerminal.Terminal.Shell.AddCommand("rgpnow", (CommandTerminal.CommandArg[] args) => {
            PlayerPrefs.DeleteKey("gamePath");
            PlayerPrefs.Save();
            Debug.Log("Game path was removed from PlayerPrefs!");
        }, 0, 0, "Resets the game path in PlayerPrefs");

        gameVersion.text = GameAPI.GAME_VERSION;
        buildTime.text   = string.Format("Build Time: {0}", BuildInfo.BuildTime());
    }