Пример #1
0
    //TODO: save diary|different users|different days
    //Evtl. save auslagern in eigene klasse

    void Start()
    {
        inputField      = gameObject.GetComponent <InputField>();
        controllerInput = controller.GetComponent <PS4ControllerInput>();
        controllerInput.onButtonPressed += onButtonPressed;
        controllerInput.onCharInput     += onCharInput;
        //userID = "Tobi";
        date        = System.DateTime.Now;
        currentDate = date;
        placeholder = inputField.placeholder.GetComponent <Text>();
        for (int i = 0; i < 7; i++)
        {
            currentDate = currentDate.AddDays(1.0d);
            string d_string = currentDate.DayOfWeek.ToString();
            if (!File.Exists(Application.persistentDataPath + "/diary_" + d_string + "_" + userID + ".if"))
            {
                saveText();
            }
            else
            {
                loadText(currentDate, userID);
            }
        }
        currentDate = date;
    }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        controllerInput = GameObject.FindGameObjectWithTag("GameController").GetComponent <PS4ControllerInput>();
        controllerInput.onButtonPressed += onButtonPressed;

        environmentA.SetActive(false);
        environmentB.SetActive(false);
    }
Пример #3
0
    // Use this for initialization
    void Start()
    {
        controllerInput = GameObject.FindGameObjectWithTag("GameController").GetComponent <PS4ControllerInput>();

        keyMapping = new Dictionary <KeyCode, ButtonType>();

        keyMapping.Add(KeyCode.UpArrow, ButtonType.TRIANGLE);
        keyMapping.Add(KeyCode.LeftArrow, ButtonType.QUADRAT);
        keyMapping.Add(KeyCode.RightArrow, ButtonType.CIRCLE);
        keyMapping.Add(KeyCode.DownArrow, ButtonType.X);

        keyMapping.Add(KeyCode.Backspace, ButtonType.L1);
        keyMapping.Add(KeyCode.Alpha3, ButtonType.L2);
        keyMapping.Add(KeyCode.Alpha4, ButtonType.R2);
        keyMapping.Add(KeyCode.Alpha5, ButtonType.L3);
        keyMapping.Add(KeyCode.Alpha6, ButtonType.R3);

        keyMapping.Add(KeyCode.Escape, ButtonType.PS);
    }