Ejemplo n.º 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();
	}
Ejemplo n.º 2
0
    void Awake()
    {
        if (GameObject.FindGameObjectsWithTag("UICtrl").Length > 1)
        {
            Destroy(gameObject);
        }
        else
        {
            shopCanvas     = transform.Find("ShopCanvas").gameObject;
            RankCanvas     = transform.Find("RankCanvas").gameObject;
            uiStateMachine = new UIStateMachine();
            GameStartState gameStartState = new GameStartState(transform);
            uiStateMachine.AddState(gameStartState);

            GameSceneState gameSceneState = new GameSceneState(transform);
            uiStateMachine.AddState(gameSceneState);

            GameLoadingState gameLoadingState = new GameLoadingState(transform);
            uiStateMachine.AddState(gameLoadingState);

            uiStateMachine.ChangeState(typeof(GameLoadingState));

            DontDestroyOnLoad(gameObject);
        }
    }
Ejemplo n.º 3
0
 public override void Unload()
 {
     Array.Resize(ref Main.cursorTextures, 17);
     On.Terraria.Main.DrawInterface_36_Cursor -= Main_DrawInterface_36_Cursor;
     Instance       = null;
     UIStateMachine = null;
     SkinManager    = null;
     base.Unload();
 }
Ejemplo n.º 4
0
        internal void OpenColorChooser(PropertyInfo info, UIElement target, IUIUpdateable updateable)
        {
            UIStateMachine.Activate("ColorChooser");
            var chooser = (ColorChooser)UIStateMachine.GetState("ColorChooser");

            UIStateMachine.FocusOn(chooser, Main._drawInterfaceGameTime);
            chooser.SelectedColor = (Color)info.GetValue(target);
            chooser.Info          = info;
            chooser.Target        = target;
            chooser.Inspecter     = updateable;
        }
Ejemplo n.º 5
0
        public override void Load()
        {
            Instance    = this;
            SkinManager = new SkinManager();

            UIStateMachine = new UIStateMachine();
            UIStateMachine.Add(new EditorState("Editor"));
            _toolBarState = new BottomToolBarState("ToolbarBottom");
            UIStateMachine.Add(_toolBarState);
            // UIStateMachine.Add(new TestState2("tstate2"));
            UIStateMachine.Add(new ColorChooser("ColorChooser"));
        }
Ejemplo n.º 6
0
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Ejemplo n.º 7
0
 public UIStateQuestDebug(UIStateMachine sm)
 {
     SM = sm;
     BeginState();
 }
Ejemplo n.º 8
0
 public UIStateJournal(UIStateMachine sm)
 {
     SM = sm;
     BeginState();
 }
Ejemplo n.º 9
0
 public UIStateUndocking(UIStateMachine sm)
 {
     Name = "UIStateUndocking";
     SM   = sm;
     BeginState();
 }
Ejemplo n.º 10
0
 public UIStateRepair(UIStateMachine sm)
 {
     Name = "UIStateRepair";
     SM   = sm;
     BeginState();
 }
Ejemplo n.º 11
0
 public UIStateEconDebug(UIStateMachine sm)
 {
     Name = "UIStateEconDebug";
     SM   = sm;
     BeginState();
 }
Ejemplo n.º 12
0
 public UIStatePowerManagement(UIStateMachine sm)
 {
     Name = "UIStatePowerManagement";
     SM   = sm;
     BeginState();
 }
Ejemplo n.º 13
0
 public UIStateLootBody(UIStateMachine sm)
 {
     SM = sm;
     BeginState();
 }
Ejemplo n.º 14
0
    void Start()
    {
        nativeResolution.x = Screen.width;
        nativeResolution.y = Screen.height;

        playerController = GameObject.FindWithTag("Player").GetComponent<PlayerController>();
        player = GameObject.FindWithTag("Player").GetComponent<PlayerEntity>();

        guiState = States.INGAME;

        stateMachine = new UIStateMachine((int)States.MACHINE_ROOT, this);
        stateMachine.AddDefaultState(new InGameUI((int)States.INGAME, this));
        stateMachine.AddState(new MenuUI((int)States.MENU, this));
        stateMachine.AddState(new CharacterUI((int)States.CHARACTER, this));
        stateMachine.AddState(new LevelupUI((int)States.LEVELUP, this));
        stateMachine.AddState(new TalentUI((int)States.TALENT, this));
        stateMachine.AddState(new SpellbookUI((int)States.SPELLBOOK, this));
        stateMachine.AddState(new AttributesUI((int)States.ATTRIBUTES, this));
        stateMachine.AddState(new LootUI((int)States.LOOT, this));

        style.normal.textColor = Color.white;

        draggedEquip = null;
    }
Ejemplo n.º 15
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();
    }
Ejemplo n.º 16
0
 public UIStateInventory(UIStateMachine sm)
 {
     SM = sm;
     BeginState();
 }
Ejemplo n.º 17
0
 public UIStateInFlight(UIStateMachine sm)
 {
     Name = "UIStateInFlight";
     SM   = sm;
     BeginState();
 }
Ejemplo n.º 18
0
 public UIStateTraderPanel(UIStateMachine sm)
 {
     Name = "UIStateTraderPanel";
     SM   = sm;
     BeginState();
 }
Ejemplo n.º 19
0
 public UIStateStationShipInfo(UIStateMachine sm)
 {
     Name = "UIStateStationShipInfo";
     SM   = sm;
     BeginState();
 }
Ejemplo n.º 20
0
 public UIStateSerumCraft(UIStateMachine sm)
 {
     SM = sm;
     BeginState();
 }
Ejemplo n.º 21
0
	public UIStateLootBody(UIStateMachine sm)
	{
		SM = sm;
		BeginState();
	}
Ejemplo n.º 22
0
 public UIStateIntro(UIStateMachine sm)
 {
     SM = sm;
     BeginState();
 }
Ejemplo n.º 23
0
	public UIStateDialogue(UIStateMachine sm)
	{
		SM = sm;
		BeginState();
	}
Ejemplo n.º 24
0
 public UIStateKeyBinding(UIStateMachine sm)
 {
     Name = "UIStateKeyBinding";
     SM   = sm;
     BeginState();
 }
Ejemplo n.º 25
0
	public UIStateInventory(UIStateMachine sm)
	{
		SM = sm;
		BeginState();
	}
Ejemplo n.º 26
0
 public UIStateLootChest(UIStateMachine sm)
 {
     SM = sm;
     BeginState();
 }
Ejemplo n.º 27
0
 public UIStateInStation(UIStateMachine sm)
 {
     Name = "UIStateInStation";
     SM   = sm;
     BeginState();
 }
Ejemplo n.º 28
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);
    }
Ejemplo n.º 29
0
 public UIStateDialogue(UIStateMachine sm)
 {
     SM = sm;
     BeginState();
 }
Ejemplo n.º 30
0
	public UIStateLootChest(UIStateMachine sm)
	{
		SM = sm;
		BeginState();
	}
Ejemplo n.º 31
0
 public UIStateNormal(UIStateMachine sm)
 {
     SM = sm;
     BeginState();
 }
Ejemplo n.º 32
0
	public UIStateNormal(UIStateMachine sm)
	{
		SM = sm;
		BeginState();
	}
Ejemplo n.º 33
0
 public UIStateResting(UIStateMachine sm)
 {
     SM = sm;
     BeginState();
 }
Ejemplo n.º 34
0
    private void Awake()
    {
        Screen.SetResolution(7680, 3240, true, 60);

        DicUI = new Dictionary <UIState, UIStateFSM>();

        _Machine = new UIStateMachine(this);

        DicUI.Add(UIState.CompanyIntroduction, new CompanyIntroductionFSM(this.transform.Find("CompanyIntroduction/CompanyIntroduction")));
        DicUI.Add(UIState.PrivateHeirs, new PrivateHeirsFSM(this.transform.Find("CompanyIntroduction/PrivateHeirs")));
        DicUI.Add(UIState.OutstandingStyle, new OutstandingStyleFSM(this.transform.Find("CompanyIntroduction/OutstandingStyle")));
        DicUI.Add(UIState.Close, new CloseFSM(null));

        _Machine.SetCurrentState(DicUI[UIState.Close]);

        CompanyIntroductionBtn.onClick.AddListener((() =>
        {
            _Machine.ChangeState(DicUI[UIState.CompanyIntroduction]);
        }));

        PrivateHeirsBtn.onClick.AddListener((() =>
        {
            _Machine.ChangeState(DicUI[UIState.PrivateHeirs]);
        }));

        OutstandingStyleBtn.onClick.AddListener((() =>
        {
            _Machine.ChangeState(DicUI[UIState.OutstandingStyle]);
        }));

        CloseButton.onClick.AddListener((() =>
        {
            _Machine.ChangeState(DicUI[UIState.Close]);
        }));


        Btn2000_2009.transform.Find("Tip").gameObject.SetActive(true);
        Btn2000_2009.onClick.AddListener((() =>
        {
            MultiDepthMotion.ChangeState(0);
            Btn2000_2009.transform.Find("Tip").gameObject.SetActive(true);
            Btn2010_2019.transform.Find("Tip").gameObject.SetActive(false);
            Btn2020.transform.Find("Tip").gameObject.SetActive(false);
        }));
        Btn2000_2009.transform.Find("Text").GetComponent <Text>().text = SettingManager.Instance.GetDirectName(Direct.FirstDir);



        Btn2010_2019.onClick.AddListener((() =>
        {
            MultiDepthMotion.ChangeState(1);
            Btn2000_2009.transform.Find("Tip").gameObject.SetActive(false);
            Btn2010_2019.transform.Find("Tip").gameObject.SetActive(true);
            Btn2020.transform.Find("Tip").gameObject.SetActive(false);
        }));
        Btn2010_2019.transform.Find("Text").GetComponent <Text>().text = SettingManager.Instance.GetDirectName(Direct.SecondDir);

        Btn2020.onClick.AddListener((() =>
        {
            MultiDepthMotion.ChangeState(2);
            Btn2000_2009.transform.Find("Tip").gameObject.SetActive(false);
            Btn2010_2019.transform.Find("Tip").gameObject.SetActive(false);
            Btn2020.transform.Find("Tip").gameObject.SetActive(true);
        }));
        Btn2020.transform.Find("Text").GetComponent <Text>().text = SettingManager.Instance.GetDirectName(Direct.ThirdDir);
    }
Ejemplo n.º 35
0
 public UIStateConfirm(UIStateMachine sm)
 {
     SM = sm;
     BeginState();
 }
Ejemplo n.º 36
0
 void OnDestroy()
 {
     Instance = null;
 }
Ejemplo n.º 37
0
 public UIStateTrading(UIStateMachine sm)
 {
     SM = sm;
     BeginState();
 }