Ejemplo n.º 1
0
 public GuiController()
 {
     mainMenu            = new MainMenu();
     playerSelectionMenu = new PlayerSelectionMenu();
     diceSelectionMenu   = new DiceSelectionMenu();
     gameEndMenu         = new GameEndMenu();
 }
Ejemplo n.º 2
0
    void upState(Vector3 a)
    {
        pauseButtonRenderer.material.mainTexture       = pauseButtonTex[0];
        nitrousButtonRenderer.material.mainTexture     = nitrousButton[0];
        brakeRenderer.material.mainTexture             = brakeButtonTex [0];
        CameraChangeAngleRenderer.material.mainTexture = CameraChangeAngleText[0];
        buttonRenders[2].material.mainTexture          = buttonTex[0];
        isBrakesOn = false;
        Ray ray = UICamera.ScreenPointToRay(a);

        if (Physics.Raycast(ray, out hit, 500))
        {
            string objName = hit.collider.name;

            switch (objName)
            {
            case "PlayAgain":
                GamePlayController.isGameEnded = false;
                GameEndMenu.SetActive(false);
                Loading.SetActive(true);
                //Application.LoadLevel(Application.loadedLevelName);
                Invoke("LoadingBg", 0.5f);
                break;

            case "mainmenu":
                Application.LoadLevel("mainMenu");
                break;

            case "fShare":
                Debug.Log("fb share post");
                string url = "https://www.facebook.com/AceGamesHyderabad";
                Application.OpenURL(url);
                break;

            case "resume":
                Time.timeScale = 1;
                pauseButton.SetActive(true);
                pauseMenu.SetActive(false);
                coinIngameCointainer.SetActive(true);
                distanceInGameContainer.SetActive(true);
                NitrousUiParent.SetActive(true);

                break;

            case "pauseIngame":

                Time.timeScale = 0;
                pauseMenu.SetActive(true);
                coinIngameCointainer.SetActive(false);
                distanceInGameContainer.SetActive(false);
                NitrousUiParent.SetActive(false);
                pauseButton.SetActive(false);

                break;

            case "NitrousButton":

                NitrousIndicator.Static.isNitrousOn = false;
                playerBIKEControl.isDoubleSpeed     = 1.0f;

                break;

            case "CameraChangeAngleBtn":

                BIKECamera.Static.ChangeCamera();
                break;
            }
        }
        foreach (Renderer r in buttonRenders)
        {
            r.material.mainTexture = buttonTex[0];
        }
    }
Ejemplo n.º 3
0
    // Use this for initialization
    public void _initUI()
    {
        //Debug.Log("Init uimanager" + Global.gameUI.gameObject.transform.GetChild(0).gameObject.name);

        foreach (Transform child in Global.gameUI.gameObject.transform.GetChild(0))
        {
            if (child.gameObject.name == "InGameUI")
            {
                inGameUI = child.gameObject.GetComponent<InGameUI>();
            }

            else if (child.gameObject.name == "PauseMenu")
            {
                pauseUI = child.gameObject.GetComponent<UIHandler>();
            }

            else if (child.gameObject.name == "GameEndMenu" && gameEndMenu == null)
            {
                gameEndMenu = child.gameObject.GetComponent<GameEndMenu>();

            }
            else if (child.gameObject.name == "InGameInstruction")
            {
                inGameInstructions = child.gameObject.GetComponent<InGameInstruction>();
            }
        }

        foreach (Transform child in gameEndMenu.gameObject.transform)
        {
            if (child.name == "NextLevel_Button")
            {
                child.gameObject.GetComponent<Button>().onClick.AddListener(delegate { Global.levelSystem.nextLevel(true); });
            }
            else if (child.name == "BackToMenu_Button")
            {
                child.gameObject.GetComponent<Button>().onClick.AddListener(delegate { Global.sceneManager._changeSceneWithName("MainMenu"); });
            }
            else if (child.name == "Retry_Button")
            {
                child.gameObject.GetComponent<Button>().onClick.AddListener(delegate { Global.levelSystem.resetLevel(true); });
            }
        }

        gameEndMenu.gameObject.SetActive(false);

        foreach (Transform child in pauseUI.gameObject.transform)
        {
            if (child.name == "NextLevel_Button")
            {
                child.gameObject.GetComponent<Button>().onClick.AddListener(delegate { Global.levelSystem.nextLevel(); });
            }
            else if (child.name == "BackToMenu_Button")
            {
                child.gameObject.GetComponent<Button>().onClick.AddListener(delegate { Global.sceneManager._changeSceneWithName("MainMenu"); });
            }
            else if (child.name == "Retry_Button")
            {
                child.gameObject.GetComponent<Button>().onClick.AddListener(delegate { Global.levelSystem.resetLevel(); });
            }

        }
        pauseUI.gameObject.SetActive(false);
    }