コード例 #1
0
	// Use this for initialization
	public void Load (ArrayList loadParameters) {

		// Reproducimos la musica de esta pantalla
		App.thisApp.controller.audio.playMusic (eMusic.Home);
		
		// Asignamos los eventos de los botones
		Button button1CreateStory = this.transform.FindChild("PanelMinigames/Button1CreateStory").GetComponent<Button>();
		button1CreateStory.onClick.AddListener( () => {
			App.thisApp.controller.audio.playFX(eAudioFX.ButtonOpenGame);
			App.thisApp.view.showScreen(eScreen.S1_CreateStory);
		});		
		Button button2PuzzleMolas = this.transform.FindChild("PanelMinigames/Button2PuzzleMolas").GetComponent<Button>();
		button2PuzzleMolas.onClick.AddListener( () => {
			App.thisApp.controller.audio.playFX(eAudioFX.ButtonOpenGame);
			App.thisApp.view.showScreen(eScreen.S2_PuzzleMolas);
		});		
		Button button3Iconography = this.transform.FindChild("PanelMinigames/Button3Iconography").GetComponent<Button>();
		button3Iconography.onClick.AddListener( () => {
			App.thisApp.controller.audio.playFX(eAudioFX.ButtonOpenGame);
			App.thisApp.view.showScreen(eScreen.S3_Iconography);
		});		
		Button button4HandicraftsAR = this.transform.FindChild("PanelMinigames/Button4HandicraftsAR").GetComponent<Button>();
		button4HandicraftsAR.onClick.AddListener( () => {
			App.thisApp.controller.audio.playFX(eAudioFX.ButtonOpenGame);
			App.thisApp.view.showScreen(eScreen.S4_HandicraftsAR);
		});
		Button button5Language = this.transform.FindChild("PanelMinigames/Button5Language").GetComponent<Button>();
		button5Language.onClick.AddListener( () => {
			App.thisApp.controller.audio.playFX(eAudioFX.ButtonOpenGame);
			App.thisApp.view.showScreen(eScreen.S5_Language);
		});

		// Referenciamos los elementos a animar
		title = this.transform.FindChild ("Title").GetComponent<RectTransform>();
		panelMinigames = this.transform.FindChild ("PanelMinigames").GetComponent<RectTransform> ();

		// Sacamos el titulo y barra de navegacion de la pantalla
		title.anchoredPosition =	new Vector2(0.0f, 	// Centrado
									title.rect.height); // Arriba de la pantalla

		panelMinigames.anchoredPosition =	new Vector2(0.0f, 				// Centrado
											-panelMinigames.rect.height); 	// Abajo de la pantalla

		// Definimos el estado inicial
		state = ScreenHomeState.TitleDown;
	}
コード例 #2
0
	void Update(){

		switch (state) {

		case ScreenHomeState.TitleDown:
			title.Translate(0, -2.0f * Time.deltaTime, 0);

			if (title.anchoredPosition.y <= 0.0f) {
				state = ScreenHomeState.TitleStatic;
				Invoke ("changeToTitleUp", 3.5f);
			}
			break;

		case ScreenHomeState.TitleStatic:
			// Do Nothing
			break;

		case ScreenHomeState.TitleUp:
			title.Translate(0, +3.0f * Time.deltaTime, 0);

			if (title.anchoredPosition.y >= title.rect.height) {
				state = ScreenHomeState.NavigationUp;
			}
			break;

		case ScreenHomeState.NavigationUp:
			panelMinigames.Translate(0, +3.0f * Time.deltaTime, 0);

			if (panelMinigames.anchoredPosition.y >= 0.0f) {
				state = ScreenHomeState.Done;
			}
			break;

		case ScreenHomeState.Done:
			// Do Nothing
			break;
		}
	}
コード例 #3
0
	private void changeToTitleUp(){
		state = ScreenHomeState.TitleUp;
	}