//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; }
// Use this for initialization void Start() { controllerInput = GameObject.FindGameObjectWithTag("GameController").GetComponent <PS4ControllerInput>(); controllerInput.onButtonPressed += onButtonPressed; environmentA.SetActive(false); environmentB.SetActive(false); }
// 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); }