void KeyFunc_LoadUI() { if (UISaveLoad.Instance.isShow) { UISaveLoad.Instance.Hide(); } else if (!UISystemMenu.IsSystemOping()) { GameUI.Instance.mSystemMenu.OnLoadBtn(); } }
void Awake() { mInstance = this; }
// Update is called once per frame void Update() { // MousePicker.IPickable player = null; // if (Pathea.MainPlayer.Instance != null && Pathea.MainPlayer.Instance.entity != null) // player = Pathea.MainPlayer.Instance.entity.GetComponent<MousePickablePeEntity>()as MousePicker.IPickable; // // if (CursorState.self.Handler == null && MousePicker.Instance.curPickObj != null && player != MousePicker.Instance.curPickObj) // { // CursorState.self.SetHandler(m_CursorHandler); // } // else // { // if (MousePicker.Instance.curPickObj == null) // CursorState.self.ClearHandler(m_CursorHandler); // } if (GameUI.Instance == null) { return; } if (null != GameUI.Instance.mMainPlayer && !GameConfig.IsInVCE && !UICamera.inputHasFocus) { if (PeInput.Get(PeInput.LogicFunction.OptionsUI)) { KeyFunc_OptionUI(); } else if (PeInput.Get(PeInput.LogicFunction.SaveMenuUI)) { if (!GameConfig.IsMultiMode) { KeyFunc_SaveUI(); } } else if (PeInput.Get(PeInput.LogicFunction.LoadMenuUI)) { if (!GameConfig.IsMultiMode) { KeyFunc_LoadUI(); } } } if (GameConfig.IsInVCE) { //lz-2016.10.12 改为逻辑按键 if (PeInput.Get(PeInput.LogicFunction.CreationSystem) && !UICamera.inputHasFocus) { // VCEditor.Quit(); if (VCEditor.Instance != null && VCEditor.Instance.m_UI != null) { VCEditor.Instance.m_UI.OnQuitClick(); } } } if (null != GameUI.Instance.mMainPlayer && !GameConfig.IsInVCE && !UISystemMenu.IsSystemOping() && !UICamera.inputHasFocus) { if (PeInput.Get(PeInput.LogicFunction.PackageUI)) { KeyFunc_ItemPackge(); } if (PeInput.Get(PeInput.LogicFunction.WorldMapUI)) { GlobalEvent.NoticeMouseUnlock(); KeyFunc_WorldMap(); } if (PeInput.Get(PeInput.LogicFunction.CharacterUI)) { KeyFunc_Character(); } if (PeInput.Get(PeInput.LogicFunction.MissionUI)) { KeyFunc_MissionUI(); } if (PeInput.Get(PeInput.LogicFunction.ColonyUI)) { KeyFunc_ColonyUI(); } if (PeInput.Get(PeInput.LogicFunction.ReplicationUI)) { KeyFunc_ReplicationUI(); } if (PeInput.Get(PeInput.LogicFunction.FollowersUI)) { KeyFunc_FollowerUI(); } if (PeInput.Get(PeInput.LogicFunction.SkillUI)) { KeyFunc_SkillUI(); } if (PeInput.Get(PeInput.LogicFunction.HandheldPcUI)) { KeyFunc_PhoneUI(); } if (PeInput.Get(PeInput.LogicFunction.CreationSystem)) { //lz-2016.10.12 射击模式不允许打开创建系统 if (!VCEditor.s_Active && UISightingTelescope.Instance.CurType == UISightingTelescope.SightingType.Null) { VCEditor.Open(); } } if (PeInput.Get(PeInput.LogicFunction.TalkMenuUI)) { KeyFunc_TalkMenuUI(); } //lz-2016.06.28 快捷键打开游戏菜单 if (PeInput.Get(PeInput.LogicFunction.GameMenuUI)) { KeyFunc_GameMenuUI(); } #region QuickBar if (enableQuickKey) { if (PeInput.Get(PeInput.LogicFunction.QuickBar1) || Input.GetKeyDown(KeyCode.Alpha1) && Input.GetKey(KeyCode.LeftShift)) { KeyFunc_QuickBar(0); } if (PeInput.Get(PeInput.LogicFunction.QuickBar2) || Input.GetKeyDown(KeyCode.Alpha2) && Input.GetKey(KeyCode.LeftShift)) { KeyFunc_QuickBar(1); } if (PeInput.Get(PeInput.LogicFunction.QuickBar3) || Input.GetKeyDown(KeyCode.Alpha3) && Input.GetKey(KeyCode.LeftShift)) { KeyFunc_QuickBar(2); } if (PeInput.Get(PeInput.LogicFunction.QuickBar4) || Input.GetKeyDown(KeyCode.Alpha4) && Input.GetKey(KeyCode.LeftShift)) { KeyFunc_QuickBar(3); } if (PeInput.Get(PeInput.LogicFunction.QuickBar5) || Input.GetKeyDown(KeyCode.Alpha5) && Input.GetKey(KeyCode.LeftShift)) { KeyFunc_QuickBar(4); } if (PeInput.Get(PeInput.LogicFunction.QuickBar6) || Input.GetKeyDown(KeyCode.Alpha6) && Input.GetKey(KeyCode.LeftShift)) { KeyFunc_QuickBar(5); } if (PeInput.Get(PeInput.LogicFunction.QuickBar7) || Input.GetKeyDown(KeyCode.Alpha7) && Input.GetKey(KeyCode.LeftShift)) { KeyFunc_QuickBar(6); } if (PeInput.Get(PeInput.LogicFunction.QuickBar8) || Input.GetKeyDown(KeyCode.Alpha8) && Input.GetKey(KeyCode.LeftShift)) { KeyFunc_QuickBar(7); } if (PeInput.Get(PeInput.LogicFunction.QuickBar9) || Input.GetKeyDown(KeyCode.Alpha9) && Input.GetKey(KeyCode.LeftShift)) { KeyFunc_QuickBar(8); } if (PeInput.Get(PeInput.LogicFunction.QuickBar10) || Input.GetKeyDown(KeyCode.Alpha0) && Input.GetKey(KeyCode.LeftShift)) { KeyFunc_QuickBar(9); } //lz-2016.08.08 增加翻页按键调用 if (PeInput.Get(PeInput.LogicFunction.PrevQuickBar)) { KeyFunc_PrevQuickBar(); } if (PeInput.Get(PeInput.LogicFunction.NextQuickBar)) { KeyFunc_NextQuickBar(); } } #endregion } }
// add game ui void InstantiateGameUI() { // gameMain GameObject gameUI = AddUIPrefab(GameMainPrefab, gameObject.transform); mUIGameMenuCtrl = gameUI.GetComponentsInChildren <UIGameMenuCtrl>(true)[0]; mUIGameMenuCtrl.Show(); mUIMainMidCtrl = gameUI.GetComponentsInChildren <UIMainMidCtrl>(true)[0]; mUIMainMidCtrl.Show(); mUIMinMapCtrl = gameUI.GetComponentsInChildren <UIMinMapCtrl>(true)[0]; mUIMinMapCtrl.Show(); mNPCTalk = gameUI.GetComponentsInChildren <UINPCTalk>(true)[0]; mNPCTalk.Hide(); mNPCSpeech = gameUI.GetComponentInChildren <UINpcSpeech>(); mServantTalk = gameUI.GetComponentsInChildren <UIServantTalk>(true)[0]; mServantTalk.Hide(); gameUI.SetActive(true); //UI System gameUI = AddUIPrefab(SytemPrefab, gameObject.transform); mSystemMenu = gameUI.GetComponentInChildren <UISystemMenu>(); mSystemMenu.e_OnShow += OnSystemWndShow; mSystemMenu.e_OnHide += OnSystemWndHide; mOption = gameUI.GetComponentInChildren <UIOption>(); mOption.e_OnShow += OnSystemWndShow; mOption.e_OnHide += OnSystemWndHide; mSaveLoad = gameUI.GetComponentInChildren <UISaveLoad>(); mSaveLoad.e_OnShow += OnSystemWndShow; mSaveLoad.e_OnHide += OnSystemWndHide; gameUI.SetActive(true); //Map gameUI = AddUIPrefab(worldMapPrefab, gameObject.transform); mUIWorldMap = gameUI.GetComponent <UIWorldMapCtrl>(); gameUI.SetActive(false); // UI Build gameUI = AddUIPrefab(buildPrefab, gameObject.transform); mBuildBlock = gameUI.GetComponent <UIBuildBlock>(); gameUI.SetActive(false); // Tip end gameUI = AddUIPrefab(tipsWmdPrefab, gameObject.transform); mTipsCtrl = gameUI.GetComponent <UITips>(); gameUI.SetActive(true); // TipRecords gameUI = AddUIPrefab(tipRecordsMgrPrefab, gameObject.transform); mTipRecordsMgr = gameUI.GetComponent <UITipRecordsMgr>(); gameUI.SetActive(false); //wnd // player info gameUI = AddUIPrefab(playerInfoPrefab, tsCenter); mUIPlayerInfoCtrl = gameUI.GetComponent <UIPlayerInfoCtrl>(); gameUI.transform.localPosition = UIDefaultPostion.Instance.pos_PlayerInfo; gameUI.SetActive(false); mUIPlayerInfoCtrl.transform.localPosition = UIDefaultPostion.Instance.pos_PlayerInfo; // Item Package gameUI = AddUIPrefab(ItemPackagePrefab, tsCenter); mItemPackageCtrl = gameUI.GetComponent <UIItemPackageCtrl>(); gameUI.SetActive(false); mItemPackageCtrl.transform.localPosition = UIDefaultPostion.Instance.pos_ItemPackge; // Npc Strage gameUI = AddUIPrefab(npcStoragePrefab, tsCenter); mNpcStrageCtrl = gameUI.GetComponent <UINpcStorageCtrl>(); gameUI.SetActive(false); mNpcStrageCtrl.transform.localPosition = UIDefaultPostion.Instance.pos_NpcStorage; // Compound Wnd gameUI = AddUIPrefab(compoundWndPrefab, tsCenter); mCompoundWndCtrl = gameUI.GetComponent <UICompoundWndControl>(); gameUI.SetActive(false); mCompoundWndCtrl.transform.localPosition = UIDefaultPostion.Instance.pos_Compound; // Servant Wnd gameUI = AddUIPrefab(servantWndPrefab, tsCenter); mServantWndCtrl = gameUI.GetComponent <UIServantWnd>(); gameUI.SetActive(false); mServantWndCtrl.transform.localPosition = UIDefaultPostion.Instance.pos_Servant; // Npc gameUI = AddUIPrefab(npcGuiPrefab, tsCenter); mNpcWnd = gameUI.GetComponent <UINpcWnd>(); gameUI.SetActive(false); mNpcWnd.transform.localPosition = UIDefaultPostion.Instance.pos_Npc; // Mission Wnd gameUI = AddUIPrefab(missionWndPrefab, tsCenter); mUIMissionWndCtrl = gameUI.GetComponent <UIMissionWndCtrl>(); gameUI.SetActive(false); // MissionTrack Wnd gameUI = AddUIPrefab(missionTrackWndPrefab, tsCenterOther); mMissionTrackWnd = gameUI.GetComponent <UIMissionTrackCtrl>(); mMissionTrackWnd.transform.localPosition = UIDefaultPostion.Instance.pos_MissionTruck; // mMissionTrackWnd.transform.localPosition = new Vector3 (856,162,0); mMissionTrackWnd.transform.localPosition = new Vector3(Screen.width / 2 - 145, 35, 0); gameUI.SetActive(false); // Get Item Wnd gameUI = AddUIPrefab(itemGetWndPrefab, tsCenter); mItemGet = gameUI.GetComponent <UIItemGet>(); gameUI.SetActive(false); // Item Option Wnd gameUI = AddUIPrefab(itemOpGuiPrefab, tsCenter); mItemOp = gameUI.GetComponent <UIItemOp>(); gameUI.SetActive(false); // Shop Wnd gameUI = AddUIPrefab(shopGuiPrefab, tsCenter); mShopWnd = gameUI.GetComponent <UIShopWnd>(); gameUI.SetActive(false); mShopWnd.transform.localPosition = UIDefaultPostion.Instance.pos_Shop; // Item Box gameUI = AddUIPrefab(itemBoxGuiPrefab, tsCenter); mItemBox = gameUI.GetComponent <UIItemBox>(); gameUI.SetActive(false); // Repair Wnd gameUI = AddUIPrefab(repairWndGuiPrefab, tsCenter); mRepair = gameUI.GetComponent <UIRepairWnd>(); gameUI.SetActive(false); mRepair.transform.localPosition = UIDefaultPostion.Instance.pos_Repair; // Power Plant Solar Wnd gameUI = AddUIPrefab(powerPlantSolarPrefab, tsCenter); mPowerPlantSolar = gameUI.GetComponent <UIPowerPlantSolar>(); gameUI.SetActive(false); mPowerPlantSolar.transform.localPosition = UIDefaultPostion.Instance.pos_PowerPlant; // Revive Gui Wnd gameUI = AddUIPrefab(reviveGuiPrefab, tsCenter); mRevive = gameUI.GetComponent <UIRevive>(); gameUI.SetActive(false); // Ware House Wnd gameUI = AddUIPrefab(wareHouseGuiPrefab, tsCenter); mWarehouse = gameUI.GetComponent <UIWarehouse>(); gameUI.SetActive(false); mWarehouse.transform.localPosition = UIDefaultPostion.Instance.pos_WareHouse; //colony Wnd gameUI = AddUIPrefab(colonyWndPrefab, tsCenter); mCSUI_MainWndCtrl = gameUI.GetComponent <CSUI_MainWndCtrl>(); gameUI.SetActive(false); //phone Wnd gameUI = AddUIPrefab(phoneWndPrefab, tsCenter); mPhoneWnd = gameUI.GetComponent <UIPhoneWnd>(); gameUI.SetActive(false); // skill wnd gameUI = AddUIPrefab(skillWndPrefab, tsCenter); mSkillWndCtrl = gameUI.GetComponent <UISkillWndCtrl>(); gameUI.SetActive(false); // workshop wnd gameUI = AddUIPrefab(workshopPrefb, tsCenter); mWorkShopCtrl = gameUI.GetComponent <UIWorkShopCtrl>(); gameUI.SetActive(false); //information wnd gameUI = AddUIPrefab(informationPrefab, tsCenter); mTeamInfoMgr = gameUI.GetComponent <CSUI_TeamInfoMgr>(); gameUI.SetActive(false); // railwayPoint gameUI = AddUIPrefab(railwayPonitPrefab, tsCenter); mRailwayPoint = gameUI.GetComponent <RailwayPointGui_N>(); gameUI.SetActive(false); // mallWndPrefab if (Pathea.PeGameMgr.IsMulti) { gameUI = AddUIPrefab(mallWndPrefab, tsCenter); mMallWnd = gameUI.GetComponent <UIMallWnd>(); gameUI.SetActive(false); } //UI Adminstrator //AdminUI gameUI = AddUIPrefab(AdministratorPrefab, tsCenter); mAdminstratorWnd = gameUI.GetComponent <UIAdminstratorWnd>(); gameUI.SetActive(false); // Driving UI gameUI = AddUIPrefab(drivingPrefab, tsCenterOther); mDrivingCtrl = gameUI.GetComponent <UIDrivingCtrl>(); gameUI.SetActive(false); // Custom stopwatch UI gameUI = AddUIPrefab(stopwatchPrefab, transform); mStopwatchList = gameUI.GetComponent <UIStopwatchList>(); gameUI.SetActive(false); // Custom npc talk UI gameUI = AddUIPrefab(npcWndCustomPrefab, tsCenter); mNpcDialog = gameUI.GetComponent <UINpcDialog>(); // Custom npc mission ui gameUI = AddUIPrefab(missionWndCustomPrefab, tsCenter); mMissionGoal = gameUI.GetComponent <UIMissionGoal>(); // Custom MissionTrack ui gameUI = AddUIPrefab(missionTrackCustomPrefab, tsCenterOther); mCustomMissionTrack = gameUI.GetComponent <UIMissionTrack>(); mCustomMissionTrack.transform.localPosition = UIDefaultPostion.Instance.pos_MissionTruck; // mMissionTrackWnd.transform.localPosition = new Vector3 (856,162,0); mCustomMissionTrack.transform.localPosition = new Vector3(Screen.width / 2 - 145, 35, 0); //lz-2016.10.22 KickstarterCtrl gameUI = AddUIPrefab(mKickstarterCtrlPrefab, tsCenter); mKickstarterCtrl = gameUI.GetComponent <KickstarterCtrl>(); gameUI.SetActive(false); //lz-2016.11.07 NpcTalkHistoryWnd gameUI = AddUIPrefab(mNpcTalkHistoryPrefab, tsCenter); mNpcTalkHistoryWnd = gameUI.GetComponent <NpcTalkHistoryWnd>(); gameUI.SetActive(false); // itemsTrack Wnd gameUI = AddUIPrefab(itemsTrackWndPrefab, tsCenterOther); mItemsTrackWnd = gameUI.GetComponent <UIItemsTrackCtrl>(); mItemsTrackWnd.transform.localPosition = mMissionTrackWnd.transform.localPosition + new Vector3(0, 170f, 0); gameUI.SetActive(false); }