Beispiel #1
0
    void OnEnable()
    {
        if (isLoaded == true)
        {
            return;
        }

        rawController = ScriptableObject.CreateInstance <UnityInput>();
        data          = ScriptableObject.CreateInstance <KeyData>();

        string playerConfig = JsonHelper.LoadSaveData("player.cfg");

        if (playerConfig != "none")
        {
            data.LoadConfig(playerConfig);

            isLoaded = true;
        }
        else
        {
            data = Resources.Load <KeyData>("Devices/keyboard");

            isLoaded = true;
        }
    }