Пример #1
0
 void saveAllVals()
 {
     thisInputCont = new inputCont();
     for (int i = 0; i < 8; i++)
     {
         inputData currInputData = new inputData();
         currInputData.id       = i;
         currInputData.minPed   = inputSystem.players[i].pedalData.min;
         currInputData.maxPed   = inputSystem.players[i].pedalData.max;
         currInputData.minWheel = inputSystem.players[i].wheelData.min;
         currInputData.maxWheel = inputSystem.players[i].wheelData.max;
         thisInputCont.savedPlayers.Add(currInputData);
     }
     thisInputCont.Save(Path.Combine(Application.persistentDataPath, "configData.xml"));
     print(Application.persistentDataPath);
     print("SAVED XML");
 }
Пример #2
0
    void Start()
    {
        inputSystem = InputSystem.s_instance;
        if (debugMode)
        {
            setDebugVals(0);
        }
        else
        {
        }

        if (configured)
        {
            thisInputCont = inputCont.Load(Path.Combine(Application.persistentDataPath, "configData.xml"));
            for (int i = 0; i < 8; i++)
            {
                inputSystem.players[i].pedalData.min = thisInputCont.savedPlayers[i].minPed;
                inputSystem.players[i].pedalData.max = thisInputCont.savedPlayers[i].maxPed;
                inputSystem.players[i].wheelData.min = thisInputCont.savedPlayers[i].minWheel;
                inputSystem.players[i].wheelData.max = thisInputCont.savedPlayers[i].maxWheel;
            }
            currentState = States.startScreen;
        }
        else
        {
            Application.LoadLevel("Config");
        }
        for (int i = 0; i < 8; i++)
        {
            isPlayingTexts[i] = GameObject.Find("P" + (i + 1)).GetComponent <Image>();
            isPlayingTexts[i].gameObject.SetActive(false);
        }
        if (counterText == null)
        {
            counterText = GameObject.Find("Timer").GetComponent <Text>();
        }
    }