/// <summary> /// 入力処理の更新 /// </summary> void Update() { #if UNITY_EDITOR if (keyboard == null) { keyboard = new KeyboardInput(); } if (joystick == null) { joystick = new JoyStickInput(); } if (touch == null) { touch = new TouchInput(); } #endif float deltaTime = Time.deltaTime; if (useKeyboard) { keyboard.Update(deltaTime, EventSystem.current); } if (useJoyStick) { joystick.Update(deltaTime); } if (useTouchInput) { touch.Update(deltaTime, EventSystem.current); } }
/// <summary> /// 有効な入力デバイスに対応したクラスを作成する /// </summary> void Start() { if (useKeyboard) { keyboard = new KeyboardInput(); } if (useJoyStick) { joystick = new JoyStickInput(); } if (useTouchInput) { touch = new TouchInput(); } }