/* * void OnGUI() { * * if(customSkin != null) { * GUI.skin = customSkin; * } * * float offset = Screen.currentResolution.width / 1280.0f; * * if (GUI.Button(new Rect(0, 0, 170 * offset, 170 * offset), worldButton)){ * Application.LoadLevel(0); * } * * if(GUI.Button(new Rect(Screen.currentResolution.width - 170 * offset, 0, 170 * offset, 170 * offset), homeButton)) { * Application.LoadLevel(2); * } * } */ void Update() { //back button if (Application.platform == RuntimePlatform.Android) { if (Input.GetKey(KeyCode.Escape)) { AGGameState.gotoHomeScreen(); } } }
void FingerGestures_OnFingerTap(int fingerIndex, Vector2 fingerPos, int tapCount) { GameObject selection = PickObject(fingerPos); if (selection == null) { return; } if (homeButton != null && selection.name.Equals(homeButton.name)) { AGGameState.gotoHomeScreen(); } if (worldButton != null && selection.name.Equals(worldButton.name)) { AGGameState.switchWorlds(currentWorldIndex); } }