// Used for initialization
	void Start () {
        _gameStateInstance = this;
        players = new List<Team>();
        players.Add(new Team(bocceBallPrefabTeam1, "BLUE TEAM", blueTeamBanner));
        players.Add(new Team(bocceBallPrefabTeam2, "RED TEAM", redTeamBanner));
        currentTeam = players[0];

        ballSet = new List<GameObject>();


        GameObject.Instantiate(playerPrefab);
        // now that the player is created, store a reference to its MouseLook component
        mouseLook = (MouseLook)FindObjectOfType(typeof(MouseLook));
        GameObject.Instantiate(guiPrefab);

        mouseLook.toggleMouseLock();
        menuFunction = resetGame;
        gameMenuMessage = "Play Next Round";
        gameState = State.Menu;


	}
Example #2
0
 public void AddItem(GUIContent content, bool on, MenuFunction func)
 {
     string path;
     MenuItem parent = AddHierarchy (ref content, out path);
     if (parent != null)
         parent.subItems.Add (new MenuItem (path, content, func));
     else
         menuItems.Add (new MenuItem (path, content, func));
 }
Example #3
0
 public MenuItem(string _path, GUIContent _content, MenuFunction _func)
 {
     path = _path;
     content = _content;
     func = _func;
 }
Example #4
0
		private NuGenMenuFunctionShortcut FindMenuFunctionShortcut(MenuFunction menuFunction)
		{
			NuGenMenuFunctionShortcut result = null;
			int index = 0;

			while (result == null && index < Shortcuts.Count)
			{
				NuGenMenuFunctionShortcut menuFunctionShortcut = Shortcuts[index++];

				if (menuFunctionShortcut.MenuFunction == menuFunction)
				{
					result = menuFunctionShortcut;
				}
			}

			return result;
		}
		public NuGenBaseMenuInformation(MenuFunction menuFunction)
			: this()
		{
			MenuFunction = menuFunction;
		}
Example #6
0
			public MenuItem (string path, GUIContent content, MenuFunction func)
			{
				Path = path;
				Content = content;
				Func = func;
			}
Example #7
0
 public void AddItem(GUIContent content, bool on, MenuFunction func)
 {
     this.menuItems.Add(new MenuItem(content, false, on, func));
 }
    // determineGameState returns the state of the game after checking the game state variables
    // returns States Pallino_Throw, Bocce_Throw, or Menu
    public State determineGameState()
    {
        State currentGameState;

        // If a pallino ball has not been set, then the state is activated to begin the game
        if (currentPallinoBall == null)
        {
            currentGameState = State.Pallino_Throw;
            gameStateMessage = currentTeam.teamName + "'s pallino throw";
        }
        // If all the balls have been thrown for a round, an appriopriate menuFunction is set 
        // in order to start the next round or game
        else if(ballsThrown >= Constants.NUMBER_OF_BALLS_PER_TEAM * 2)
        {
            // set the state to menu so that player can have a moment to look at the game results
            currentGameState = State.Menu;
            mouseLook.toggleMouseLock();

            // add the round score to the in-team's score
            currentWinningTeam.totalScore += currentWinningTeam.currentScore;

            // if the team has reached the max score possible, end the game
            if (currentWinningTeam.totalScore >= Constants.MAX_SCORE)
            {
                currentGameState = State.Menu;
                gameStateMessage = currentWinningTeam.teamName + " Wins!!!!";
                gameMenuMessage = "Play Next Game";
                menuFunction = resetGame;
            }
            // if the max score has not been reached, switch to the next round
            else
            {
                currentGameState = State.Menu;
                gameStateMessage = currentWinningTeam.teamName + " wins this round";
                gameMenuMessage = "Play Next Round";
                menuFunction = resetRound;
            }
            
        }else // there are still bocce balls to be thrown
        {
            currentGameState = State.Bocce_Throw;
        }
        return currentGameState;
    }