Example #1
0
		//Input of the system
		void OnInput ()
		{
				switch (gameSystem.state) {
				case GameState.PAUSE: 
						{	
								//Unpause game
								if (Input.GetButtonDown ("Start")) {
										gameSystem.State = GameState.BATTLE;
								}
						}
						break;
				case GameState.BATTLE:
						{
								//Pause game
								if (Input.GetButtonDown ("Start")) {
										gameSystem.State = GameState.PAUSE;
										return;
								}
					
								//Input states
								var rotateLeft = Input.GetButtonDown ("L1");
								var rotateRight = Input.GetButtonDown ("R1");
								var tilt = rotateLeft && rotateRight;
						
								//Rotate-Tilt
								if (tilt) {
										gameSystem.Camera_Tilt ();
								} else if (rotateLeft) {
										gameSystem.Camera_RotateLeft ();
								} else if (rotateRight) {
										gameSystem.Camera_RotateRight ();
								}
						
								//Move Tile Selector
								if (!OnMoveSelector ()) {
										//Action
										OnAction ();
								}
						}
						break;
				case GameState.FIELDMAP:
						{
								//Input states
								var rotateLeft = Input.GetButtonDown ("L1");
								var rotateRight = Input.GetButtonDown ("R1");
								var tilt = rotateLeft && rotateRight;

								//Rotate-Tilt
								if (tilt) {
										gameSystem.Camera_Tilt ();
								} else if (rotateLeft) {
										gameSystem.Camera_RotateLeft ();
								} else if (rotateRight) {
										gameSystem.Camera_RotateRight ();
								}

								//Walk
								var x = Input.GetAxisRaw ("Horizontal");
								var z = Input.GetAxisRaw ("Vertical");
								var jmp = Input.GetButtonDown ("X");

								gameSystem.FieldMap_MainPlayerMove (x, z);

								if (jmp) {
										gameSystem.FieldMap_MainPlayerJump (1.0f);
								}
						}
						break;
				default:
						break;
				}
		}