Ejemplo n.º 1
0
    public void MoveToLevelSelect()
    {
        titleScreen.Play(titleScreenOut);
        levelSelect.Play(levelSelectIn);

        currentMenuScreen = menuScreen.LevelSelectScreen;
    }
Ejemplo n.º 2
0
    public void MoveToLevelSelect()
    {
        titleScreen.Play(titleScreenOut);
        levelSelect.Play(levelSelectIn);

        currentMenuScreen = menuScreen.LevelSelectScreen;
    }
Ejemplo n.º 3
0
 protected void JumpForward(menuScreen newTarg)
 {
     Disable();
     controlSingle.Instance.SetMenu(newTarg);
     newTarg.SetPrevMenu(this);
     newTarg.JumpMe();
 }
Ejemplo n.º 4
0
 void ScoreScreenGUI()
 {
     highScoreController.showScores=true;
     if(GUI.Button (new Rect(Screen.width/9*4,Screen.height/5*4,120,50),"BACK")){
         menu=menuScreen.MainMenu;
         highScoreController.showScores=false;
     }
 }
Ejemplo n.º 5
0
 void ScoreScreenGUI()
 {
     highScoreController.showScores = true;
     if (GUI.Button(new Rect(Screen.width / 9 * 4, Screen.height / 5 * 4, 120, 50), "BACK"))
     {
         menu = menuScreen.MainMenu;
         highScoreController.showScores = false;
     }
 }
Ejemplo n.º 6
0
 void MainMenuGUI()
 {
     if(GUI.Button (new Rect(Screen.width/9*4,Screen.height/2,120,50),"PLAY")){
         Application.LoadLevel(nextScene);
     }
     if(GUI.Button (new Rect(Screen.width/9*4,Screen.height/2+60,120,50),"HIGH SCORES")){
         menu=menuScreen.ScoreScreen;
     }
 }
Ejemplo n.º 7
0
 void MainMenuGUI()
 {
     if (GUI.Button(new Rect(Screen.width / 9 * 4, Screen.height / 2, 120, 50), "PLAY"))
     {
         Application.LoadLevel(nextScene);
     }
     if (GUI.Button(new Rect(Screen.width / 9 * 4, Screen.height / 2 + 60, 120, 50), "HIGH SCORES"))
     {
         menu = menuScreen.ScoreScreen;
     }
 }
Ejemplo n.º 8
0
    // Main Menu

    public void CreateMenuPopup()
    {
        if (IsMenu() == false)
        {
            curMenu = GameObject.Instantiate(mainMenuPrefab, myCanvas.transform).GetComponent <menuScreen>();
            PauseGame();
        }
        else
        {
            Debug.LogError("The game is trying to create the main menu but there is already a menu item");
        }
    }
Ejemplo n.º 9
0
	//menuScreen prevScreen = (menuScreen)Enum.Parse (typeof(menuScreen), currScreen.ToString);
	// Use this for initialization
	void Start ()
	{
		//Set prevScreen to currScreen
		currScreen = menuScreen.Home;
		prevScreen = currScreen;

		//Reference to this object's rectTransform
		thisRect = transform.GetComponent<RectTransform> ();

		//get initial position of bgPanel
		initialStartX = thisRect.position.x;

		//Set move distance based on menuPanel, so that we can resize menu panel in 
		//inspector and moveDist will adapt automatically
		moveDist = panelToExpose.rect.width - 1;

	}
Ejemplo n.º 10
0
 // Use this for initialization
 void Start()
 {
     InitialiseScripts();
     menu = menuScreen.MainMenu;
 }
Ejemplo n.º 11
0
	// Fixed update so that easing occurs at a rate that is not tied to framerate speed
	void FixedUpdate ()
	{
		//Counting how long user has been on current screen
		if (currScreen == prevScreen) {
			screenCount ++;
		} else {
			print ("hey");
		}

		if (isMoving) {
			if (!isShowing) {


				//Opening
				if (moveTime < openDur) {
					//Easing takes args time, start, change duration
					thisRect.position = new Vector2 ((float)Easing.CircEaseOut (moveTime, startX, moveDist, openDur), thisRect.position.y);//.center.y + thisRect.rect.height /2 );//, thisRect.rect.width,thisRect.rect.height);
					moveTime += 1;
				}
				//Finish opening, reset timer and flip position bools
				else {
					moveTime = 0;
					isShowing = true;
					isMoving = false;
				}
			} else if (isShowing) {


				//If closing after menu finished opening
				if (normalclose) {
					if (moveTime < closeDur) {
						thisRect.position = new Vector2 ((float)Easing.CubicEaseOut (moveTime, startX, -1 * (moveDist), closeDur), thisRect.position.y);
						moveTime += 1;
					} else {
						moveTime = 0;
						isShowing = false;
						isMoving = false;
						closeButton.SetActive (false);
					}
				} else if (!normalclose) {


					//if re-closed while menu is still opening 
					if (moveTime < closeDur) {
						thisRect.position = new Vector2 ((float)Easing.CubicEaseOut (moveTime, startX, initialStartX - startX, closeDur), thisRect.position.y);
						moveTime += 1;
					} else {
						moveTime = 0;
						isShowing = false;
						isMoving = false;
						closeButton.SetActive (false);
					}
				}

			}
		}
		prevScreen = currScreen;
	
	}
Ejemplo n.º 12
0
	public void triggerChangeMenu(string menuName){
		//Fade out current menu content and fade in new content based on string arg as menu closes
		//print ("Triggered switch to " + menuName);
		//print (currScreen.ToString ());
		transform.FindChild (currScreen.ToString ()).gameObject.SetActive (false);
		currScreen = (menuScreen)Enum.Parse (typeof(menuScreen), menuName);
		transform.FindChild (currScreen.ToString ()).gameObject.SetActive (true);

		//opening from fully closed
		if (!isMoving && !isShowing) {
			startX = thisRect.position.x;
			isMoving = true;
			closeButton.SetActive (true);
		} 
		//Closing while in the process of opening
		else if (isMoving && !isShowing) {
			startX = thisRect.position.x;
			closeButton.SetActive (false);
			isShowing = true;
			normalclose = false;
			moveTime = 0;
			print ("clicked while opening");
		}
		//Closing from fully open
		else if (!isMoving && isShowing) {
			startX = thisRect.position.x;
			isMoving = true;
			
		} 

	}
Ejemplo n.º 13
0
 // Use this for initialization
 void Start()
 {
     InitialiseScripts();
     menu=menuScreen.MainMenu;
 }
Ejemplo n.º 14
0
 public void SetMenu(menuScreen newMenu)
 {
     curMenu = newMenu;
 }
Ejemplo n.º 15
0
 public void SetPrevMenu(menuScreen newPrev)
 {
     prevMenu = newPrev;
 }