Exemplo n.º 1
0
 void Awake()
 {
     gScriptRef              = GameObject.Find("Main Camera").GetComponent <GalaxyCameraScript>(); // tie the game camera script to the data
     canvasRef               = GameObject.Find("System UI Canvas").GetComponent <Canvas>();
     galaxyDataRef           = GameObject.Find("GameManager").GetComponent <GalaxyData>();
     gameDataRef             = GameObject.Find("GameManager").GetComponent <GlobalGameData>();
     graphicsDataRef         = GameObject.Find("GameManager").GetComponent <GraphicAssets>();
     gScreenRef              = GameObject.Find("GameEngine").GetComponent <GalaxyScreen>();
     systemIntelLevel        = GameObject.Find("Intel Level").GetComponent <Text>();
     systemIntelText         = GameObject.Find("Intel Level Text Label").GetComponent <Text>();
     lowIntelLevelPlanetData = GameObject.Find("Low Intel Level Text").GetComponent <Text>();
     noIntelLevelPlanetData  = GameObject.Find("No Intel Level Text").GetComponent <Text>();
     noStellarObjectText     = GameObject.Find("No Stellar Object Text").GetComponent <Text>();
     //systemGovernorImage = GameObject.Find("Character Image").GetComponent<Image>();
     lowIntelLevelPlanetData.enabled = false;
 }
Exemplo n.º 2
0
        public void ChangeToScreen(Screen whichScreen)
        {
            switch (whichScreen)
            {
            case Screen.MainMenu:
                if (_mainGameMenu == null)
                {
                    _mainGameMenu = new MainGameMenu();
                    string reason;
                    if (!_mainGameMenu.Initialize(this, out reason))
                    {
                        MessageBox.Show("Exception in loading Main Menu. Reason: " + reason);
                        _parentForm.Close();
                    }
                }
                _screenInterface = _mainGameMenu;
                break;

            case Screen.NewGame:
                if (_newGame == null)
                {
                    _newGame = new NewGame();
                    string reason;
                    if (!_newGame.Initialize(this, out reason))
                    {
                        MessageBox.Show("Exception in loading New Game Menu. Reason: " + reason);
                        _parentForm.Close();
                    }
                }
                _screenInterface = _newGame;
                break;

            case Screen.Galaxy:
                if (_galaxyScreen == null)
                {
                    _galaxyScreen = new GalaxyScreen();
                    string reason;
                    if (!_galaxyScreen.Initialize(this, out reason))
                    {
                        MessageBox.Show("Exception in loading Galaxy Screen. Reason: " + reason);
                        _parentForm.Close();
                    }
                }
                _galaxyScreen.CenterScreen();
                _screenInterface = _galaxyScreen;
                break;

            case Screen.Diplomacy:
                if (_diplomacyScreen == null)
                {
                    _diplomacyScreen = new DiplomacyScreen();
                    string reason;
                    if (!_diplomacyScreen.Initialize(this, out reason))
                    {
                        MessageBox.Show("Exception in loading Diplomacy Screen. Reason: " + reason);
                        _parentForm.Close();
                    }
                }
                _diplomacyScreen.SetupScreen();
                _screenInterface = _diplomacyScreen;
                break;

            case Screen.ProcessTurn:
                EmpireManager.CurrentEmpire.ClearTurnData();
                if (_processingTurnScreen == null)
                {
                    _processingTurnScreen = new ProcessingTurnScreen();
                    string reason;
                    if (!_processingTurnScreen.Initialize(this, out reason))
                    {
                        MessageBox.Show("Exception in loading Processing Turn Screen. Reason: " + reason);
                        _parentForm.Close();
                    }
                }
                if (!EmpireManager.ProcessNextEmpire())
                {
                    _situationReport.Refresh();
                    ChangeToScreen(Screen.Galaxy);
                    break;
                }
                _screenInterface = _processingTurnScreen;
                break;

            case Screen.Battle:
                /*if (_spaceCombat == null)
                 * {
                 *      _spaceCombat = new SpaceCombat();
                 *      _spaceCombat.Initialize(this);
                 * }
                 * _spaceCombat.SetupScreen();
                 * _screenInterface = _spaceCombat;*/
                break;
            }
            _currentScreen = whichScreen;
        }