Esempio n. 1
0
    public void SetGameMode(int mode)
    {
        switch (mode)
        {
        case (0):
            currentMode = GAMEMODES.NONE;
            SwitchOffDisplayBars();
            break;

        case (1):
            if (currentMode == GAMEMODES.BUILD)
            {
                currentMode = GAMEMODES.NONE;
                SwitchOffDisplayBars();
            }
            else
            {
                currentMode = GAMEMODES.BUILD;
                SwitchDisplayedBar("build");
            }
            break;

        case (2):
            if (currentMode == GAMEMODES.DISTRIBUTION)
            {
                currentMode = GAMEMODES.NONE;
                SwitchOffDisplayBars();
            }
            else
            {
                currentMode = GAMEMODES.DISTRIBUTION;
                SwitchDisplayedBar("distribution");
            }
            break;

        case (3):
        {
            if (currentMode == GAMEMODES.DEMOLISH)
            {
                currentMode = GAMEMODES.NONE;
            }
            else
            {
                currentMode = GAMEMODES.DEMOLISH;
                SwitchOffDisplayBars();
            }
        }
        break;

        default:
            Debug.LogError("Didn't recieve handled mode setting back to none");
            currentMode = GAMEMODES.NONE;
            break;
        }
    }
Esempio n. 2
0
 void Start()
 {
     currentMode            = GAMEMODES.NONE;
     buildBarEnabled        = buildBar.activeSelf;
     distributionBarEnabled = distributionBar.activeSelf;
     builder       = FindObjectOfType <BuildingManager>();
     game          = FindObjectOfType <GameManager>();
     mouseOverUI   = false;
     displayBarMap = new Dictionary <string, GameObject>();
     SetupDisplayBarMap();
     lastMousePosition = new Vector3();
 }