Exemple #1
0
	public void Initialize()
	{
		_panels = new List<PanelBase>();
		Root = GameObject.Find("UI Root").GetComponent<UIRoot>();

		Root.manualHeight = Screen.height;
		Root.manualWidth = Screen.width;

		UICamera = Root.transform.Find("UICamera").GetComponent<Camera>();


		BarkPanel = UICamera.transform.Find("BarkPanel").GetComponent<BarkPanel>();
		BarkPanel.Initialize();

		HUDPanel = UICamera.transform.Find("HUDPanel").GetComponent<HUDPanel>();
		HUDPanel.Initialize();

		WindowPanel = UICamera.transform.Find("WindowPanel").GetComponent<WindowPanel>();
		WindowPanel.Initialize();

		DialoguePanel = UICamera.transform.Find("DialoguePanel").GetComponent<DialoguePanel>();
		DialoguePanel.Initialize();


		_panels.Add(DialoguePanel);
		_panels.Add(WindowPanel);
		_panels.Add(HUDPanel);
		_panels.Add(BarkPanel);


		UIStateMachine = new UIStateMachine();
		UIStateMachine.Initialize();
	}
Exemple #2
0
 public void DrawHUD(GameInfo game)
 {
     foreach (PlayerInfo player in game.Players)
     {
         HUDPanel.Write(String.Format("{0}:{1} ", player.Name, player.Frags), player.Colour);                                        //String.Format("Time {0:hh:mm:ss}\n", game.GameTime), ConsoleColor.Gray);
     }
 }
Exemple #3
0
 public override void HideTopPanel()
 {
     if (states.Count > 0)
     {
         HUDPanel panel = states.Pop();
         panel.gameObject.SetActive(false);
     }
     else
     {
         Input_ShowPauseMenu();
     }
 }
Exemple #4
0
 private void InitLevel()
 {
     levelRemainTimer = levelTime; //Reset level Timer
     isGameover       = false;
     hud = GameManager.Instance.mUIManager.GetPanel(UIPanelType.HUD).GetComponent <HUDPanel>();
     levelFinishDirector = player.transform.Find("DollyCamera_LevelFinish").GetComponent <PlayableDirector>();
     isPause             = true;
     currentState        = StateID.Normal;
     ballsDelivered      = 0;
     if (hud != null)
     {
         hud.UpdateBallCountOnHud(0);
     }
     GameManager.Instance.mAudioManager.PlayBGMusic("BGMusic02");
 }
 public override void HideTopPanel()
 {
     if (states.Count > 0)
     {
         if (states.Peek() is InventoryMenu)
         {
             //((InventoryMenu)states.Peek()).ReleaseItem();
         }
         HUDPanel panel = states.Pop();
         panel.gameObject.SetActive(false);
     }
     else
     {
         Input_ShowPauseMenu();
     }
 }
Exemple #6
0
    public void StartGame()
    {
        AudioManager.Instance.BGMFadeIn("bgm/Success", 0.1f, 1f, true);
        BuildingSelectPanel = UIManager.Instance.ShowUIForms <BuildingSelectPanel>();
        BuildingSelectPanel.Init(CitySetup.BuildingPrefabList.Select(buildingPrefab => buildingPrefab.BuildingInfo).ToList());
        HUDPanel = UIManager.Instance.ShowUIForms <HUDPanel>();
        HUDPanel.Init();
        CurrentSelectedBuildingKey = BuildingKey.None;
        MouseHoverManager.Instance.M_StateMachine.SetState(MouseHoverManager.StateMachine.States.Building);

        Budget                = 10000;
        OxygenCapacity        = 1000;
        Oxygen                = 1000;
        PopulationCapacity    = 0;
        PopulationNetIncrease = 0;
        Population            = 0;
        City.RefreshResourcesInfo();

        GameStart = true;
    }
 public void Input_ShowPanel(HUDPanel panel)
 {
     ShowPanel(panel);
 }
Exemple #8
0
    public void Initialize()
    {
        _panels = new List <PanelBase>();

        //GameObject uiRootObj = GameObject.Instantiate(Resources.Load("UI Root")) as GameObject;

        Root = GameObject.Find("UI Root").GetComponent <UIRoot>();

        //Root.manualHeight = Screen.height;
        //Root.manualWidth = Screen.width;

        UICamera = Root.transform.Find("Camera").GetComponent <Camera>();

        if (GameManager.Inst.SceneType == SceneType.Space)
        {
            HUDPanel = UICamera.transform.Find("HUDPanel").GetComponent <HUDPanel>();
            HUDPanel.Initialize();

            _panels.Add(HUDPanel);

            KeyBindingPanel = UICamera.transform.Find("KeyBindingPanel").GetComponent <KeyBindingPanel>();
            KeyBindingPanel.Initialize();
            _panels.Add(KeyBindingPanel);

            PowerManagementPanel = UICamera.transform.Find("PowerManagement").GetComponent <PowerManagementPanel>();
            PowerManagementPanel.Initialize();
            _panels.Add(PowerManagementPanel);

            EconDebugPanel = UICamera.transform.Find("EconDebugPanel").GetComponent <EconDebugPanel>();
            EconDebugPanel.Initialize();
            _panels.Add(EconDebugPanel);
        }
        else if (GameManager.Inst.SceneType == SceneType.SpaceTest)
        {
            HUDPanel = UICamera.transform.Find("HUDPanel").GetComponent <HUDPanel>();
            HUDPanel.Initialize();


            _panels.Add(HUDPanel);
        }
        else if (GameManager.Inst.SceneType == SceneType.Station)
        {
            StationHUDPanel = UICamera.transform.Find("StationHUDPanel").GetComponent <StationHUDPanel>();
            StationHUDPanel.Initialize();
            RepairPanel = UICamera.transform.Find("RepairPanel").GetComponent <RepairPanel>();
            RepairPanel.Initialize();
            ShipInfoPanel = UICamera.transform.Find("ShipInfoPanel").GetComponent <ShipInfoPanel>();
            ShipInfoPanel.Initialize();
            TraderPanel = UICamera.transform.Find("TraderPanel").GetComponent <TraderPanel>();
            TraderPanel.Initialize();

            ErrorMessagePanel = UICamera.transform.Find("ErrorMessagePanel").GetComponent <ErrorMessagePanel>();
            ErrorMessagePanel.Initialize();

            _panels.Add(StationHUDPanel);
            _panels.Add(RepairPanel);
            _panels.Add(ShipInfoPanel);
            _panels.Add(TraderPanel);
            _panels.Add(ErrorMessagePanel);
        }

        FadePanel = UICamera.transform.Find("FadePanel").GetComponent <FadePanel>();
        FadePanel.Initialize();
        _panels.Add(FadePanel);

        UIZoom = 1;

        UIStateMachine = new UIStateMachine();
        UIStateMachine.Initialize(GameManager.Inst.SceneType);
    }
Exemple #9
0
 private void Awake()
 {
     Instance = this;
 }
Exemple #10
0
 void Start()
 {
     HUDPanel = UIManager.Instance.ShowUIForms <HUDPanel>();
 }
Exemple #11
0
    public void Initialize()
    {
        _panels = new List <PanelBase>();

        GameObject uiRootObj = GameObject.Instantiate(Resources.Load("UI Root")) as GameObject;

        Root = uiRootObj.GetComponent <UIRoot>();

        Root.manualHeight = Screen.height;
        Root.manualWidth  = Screen.width;

        UICamera = Root.transform.Find("UICamera").GetComponent <Camera>();


        BarkPanel = UICamera.transform.Find("BarkPanel").GetComponent <BarkPanel>();
        BarkPanel.Initialize();

        HUDPanel = UICamera.transform.Find("HUDPanel").GetComponent <HUDPanel>();
        HUDPanel.Initialize();

        WindowPanel = UICamera.transform.Find("WindowPanel").GetComponent <WindowPanel>();
        WindowPanel.Initialize();

        DialoguePanel = UICamera.transform.Find("DialoguePanel").GetComponent <DialoguePanel>();
        DialoguePanel.Initialize();

        RestingPanel = UICamera.transform.Find("RestingPanel").GetComponent <RestingPanel>();
        RestingPanel.Initialize();

        ConfirmPanel = UICamera.transform.Find("ConfirmPanel").GetComponent <ConfirmPanel>();
        ConfirmPanel.Initialize();

        FadingPanel = UICamera.transform.Find("FadingPanel").GetComponent <FadingPanel>();
        FadingPanel.Initialize();
        FadingPanel.Show();
        FadingPanel.FadeIn(2);

        QuestDebugPanel = UICamera.transform.Find("QuestDebugPanel").GetComponent <QuestDebugPanel>();
        QuestDebugPanel.Initialize();

        MapPanel = UICamera.transform.Find("MapPanel").GetComponent <MapPanel>();
        MapPanel.Initialize();

        IntroPanel = UICamera.transform.Find("IntroPanel").GetComponent <IntroPanel>();
        IntroPanel.Initialize();

        _panels.Add(IntroPanel);
        _panels.Add(MapPanel);
        _panels.Add(QuestDebugPanel);
        _panels.Add(DialoguePanel);
        _panels.Add(RestingPanel);
        _panels.Add(ConfirmPanel);
        _panels.Add(WindowPanel);
        _panels.Add(HUDPanel);
        _panels.Add(BarkPanel);


        UIZoom = 1;


        UIStateMachine = new UIStateMachine();
        UIStateMachine.Initialize();
    }