Example #1
0
    // Update is called once per frame
    void Update()
    {
        switch (theCurrGameState)
        {
        case gameState.initialize:
            initialize();
            break;

        case gameState.playGame:

            //print ("<!> Enter Play Game  " + gameState.playGame + "<!>");

//				print ("<!> gameEngine " + currPlayState + "<!>");

            switch (currPlayState)
            {
            case playState.movingCubes:
                print("<!> gameEngine <!>");

                gameEngine theGameEngine = GetComponent <gameEngine>();
                theGameEngine.initMe();

                currPlayState = playState.executingTask;
                break;
            }

            break;

        case gameState.gameOver:
            //loadGameOverGameManager();
            StartCoroutine("loadGameOver");
            currPlayState = playState.movingCubes;
            break;
        }
    }
Example #2
0
    public void loadLevel(int level)
    {
        hideMenu();
        Cursor.visible = false;
        Time.timeScale = 1;

        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            scoreController score = gameControllerObject.GetComponent <scoreController>();
            if (score != null)
            {
                score.updateLevelText(level);
                score.resetStars();
                score.resetScore();
                score.resetHealth();
            }
        }

        SceneManager.LoadScene(0);

        GameObject gameEngine = GameObject.Find("GameEngine");
        gameEngine engine     = gameEngine.GetComponent <gameEngine>();

        engine.startLevel(level, false);
    }
Example #3
0
    public void loadLevelFromForm()
    {
        uiSound();
        GameObject levelListBox  = GameObject.Find("SelectLevelDropdown");
        Dropdown   levelDropdown = levelListBox.GetComponent <Dropdown>();

        GameObject gameEngine = GameObject.Find("GameEngine");
        gameEngine engine     = gameEngine.GetComponent <gameEngine>();

        if (Game.current.unlockedLevels.Contains(levelDropdown.value + 1))
        {
            loadLevel(levelDropdown.value + 1); // true ListBox values start at 0
        }
        else
        {
            showInfoDialog("You must first clear previous levels before you will be able to access this level!");
        }
    }
	public void init ()
	{
		soundComponent = GetComponentsInChildren<UIPlaySound> ();
		setSoundClipOnButton (0.5f, "uibutton", button);
		interface_engine = gameEngine.Instance;
		UILabel[] lbl = control_panel.GetComponentsInChildren<UILabel> ();
		foreach (UILabel r in lbl) {
			if (r.gameObject.name.Equals ("NameTag")) {
				nametag = r;
			}
			if (r.gameObject.name.Equals ("money")) {
				money = r;
			}
			//Debug.Log ("found the name: " + r.gameObject.name);
		}
		waiting_panel.SetActive (true);
		control_panel.SetActive (true);
		control_panel_alpha = control_panel.GetComponent<TweenAlpha> ();
		waiting_panel_alpha = waiting_panel.GetComponent<TweenAlpha> ();
		waiting_panel.SetActive (false);
		control_panel.SetActive (false);
	}
Example #5
0
		// Use this for initialization
		void Start ()
		{
				Instance = this;
				StartCoroutine (setup ());
		}
Example #6
0
		// Use this for initialization
		void Start ()
		{
				ge = GetComponent<gameEngine> ();
		}
		public void transaction_go (gameEngine ge, Action after)
		{
				if (mlvType == lvType.BUYLAND) {
						Debug.Log ("trade success by BUYLAND");
						gameEngine.Instance.trade_success (condition_money, after);
				}
				if (mlvType == lvType.UPGRADE) {
						Debug.Log ("trade success by UPGRADE");
						gameEngine.Instance.trade_success (condition_money, after);
				}
				if (mlvType == lvType.PAYRENT) {
						Debug.Log ("trade success by PAYRENT");
						gameEngine.Instance.collection_money_for_landlord (condition_money, after);
				}
		}