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(); }
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); } }
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(); }
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; }
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")); }
void Awake() { if (Instance == null) { Instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
public UIStateQuestDebug(UIStateMachine sm) { SM = sm; BeginState(); }
public UIStateJournal(UIStateMachine sm) { SM = sm; BeginState(); }
public UIStateUndocking(UIStateMachine sm) { Name = "UIStateUndocking"; SM = sm; BeginState(); }
public UIStateRepair(UIStateMachine sm) { Name = "UIStateRepair"; SM = sm; BeginState(); }
public UIStateEconDebug(UIStateMachine sm) { Name = "UIStateEconDebug"; SM = sm; BeginState(); }
public UIStatePowerManagement(UIStateMachine sm) { Name = "UIStatePowerManagement"; SM = sm; BeginState(); }
public UIStateLootBody(UIStateMachine sm) { SM = sm; BeginState(); }
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; }
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(); }
public UIStateInventory(UIStateMachine sm) { SM = sm; BeginState(); }
public UIStateInFlight(UIStateMachine sm) { Name = "UIStateInFlight"; SM = sm; BeginState(); }
public UIStateTraderPanel(UIStateMachine sm) { Name = "UIStateTraderPanel"; SM = sm; BeginState(); }
public UIStateStationShipInfo(UIStateMachine sm) { Name = "UIStateStationShipInfo"; SM = sm; BeginState(); }
public UIStateSerumCraft(UIStateMachine sm) { SM = sm; BeginState(); }
public UIStateIntro(UIStateMachine sm) { SM = sm; BeginState(); }
public UIStateDialogue(UIStateMachine sm) { SM = sm; BeginState(); }
public UIStateKeyBinding(UIStateMachine sm) { Name = "UIStateKeyBinding"; SM = sm; BeginState(); }
public UIStateLootChest(UIStateMachine sm) { SM = sm; BeginState(); }
public UIStateInStation(UIStateMachine sm) { Name = "UIStateInStation"; SM = sm; BeginState(); }
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); }
public UIStateNormal(UIStateMachine sm) { SM = sm; BeginState(); }
public UIStateResting(UIStateMachine sm) { SM = sm; BeginState(); }
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); }
public UIStateConfirm(UIStateMachine sm) { SM = sm; BeginState(); }
void OnDestroy() { Instance = null; }
public UIStateTrading(UIStateMachine sm) { SM = sm; BeginState(); }