//创建窗体 private bool Create() { if (mRoot) { Debug.LogError("Window Create Error Exist!"); return(false); } if (mResName == null || mResName == "") { Debug.LogError("Window Create Error ResName is empty!"); return(false); } if (GameMethod.GetUiCamera.transform == null) { Debug.LogError("Window Create Error GetUiCamera is empty! WindowName = " + mResName); return(false); } GameObject obj = LoadUiResource.LoadRes(GameMethod.GetUiCamera.transform, mResName); if (obj == null) { Debug.LogError("Window Create Error LoadRes WindowName = " + mResName); return(false); } mRoot = obj.transform; mRoot.gameObject.SetActive(false); return(true); }
public void AddFocoEnergiaStart() { if (null == focoEffectStart) { focoEffectStart = LoadUiResource.LoadRes(transform, GameDefine.GameConstDefine.FuryStartLongPressEffect); } }
void SkipNewsGuideMark(List <GameObject> objList) { if (taskData.TaskId == newsGuideTaskId) { //senln objSkipNewsGuide = LoadUiResource.LoadRes(/*LobbyWindow.Instance.GetRoot()*/ null, GameConstDefine.SkipNewsGuidePath); UIWidget wid = objList.ElementAt(0).GetComponent <UIWidget>(); ButtonOnPress btn; for (int i = 0; i < 2; i++) { btn = objSkipNewsGuide.transform.Find("Btn" + (i + 1).ToString()).GetComponent <ButtonOnPress>(); btn.AddListener(i, SelectSkillNewsGuide); if (btn.GetComponent <UIWidget>() == null) { btn.gameObject.AddComponent <UIWidget>(); } btn.GetComponent <UIWidget>().depth = wid.raycastDepth + 2000; } if (objSkipNewsGuide.GetComponent <UIWidget>() == null) { objSkipNewsGuide.gameObject.AddComponent <UIWidget>(); } objSkipNewsGuide.GetComponent <UIWidget>().depth = wid.raycastDepth + 1000; } }
private void LoadLockEffect() { if (null == lockEffect) { lockEffect = LoadUiResource.LoadRes(spriteLock.transform.parent, GameDefine.GameConstDefine.LockEffect); lockEffect.transform.localPosition = spriteLock.transform.localPosition; } }
private void LoadFullFuryEffect() { if (null == furyFullEffect) { furyFullEffect = LoadUiResource.LoadRes(btnFury.transform, GameDefine.GameConstDefine.FuryFullFuryInfoEffect); furyFullEffect.transform.localPosition = new Vector3(sliderFury.transform.localPosition.x, sliderFury.transform.localPosition.y, sliderFury.transform.localPosition.z - 10f); startTime = Time.time; } }
void OnEvent(long i) { EventCenter.RemoveListener <long>((Int32)GameEventEnum.GameEvent_BattleTimeDownEnter, OnEvent); TimeSpan span = GameTimeData.Instance.GetGameTime(); if (span.TotalSeconds < timeLimit) { objTip = LoadUiResource.LoadRes(GameMethod.GetUiCamera.transform, path); } }
void Update() { if (timeLimit > 0f) { float timeBetween = Time.time - timeStart; if ((timeBetween > timeLimit) && !hasShowEffect) { LoadUiResource.LoadRes(transform, path); hasShowEffect = true; } else if ((timeBetween > timeLimit +0.5f) && timeBetween < (timeLimit + showTime+0.5f) && (!objUI.activeInHierarchy)) { objUI.SetActive(true); } else if (timeBetween > (timeLimit + showTime)) { timeLimit = 0f; NotifyGameOver(); } } }
public void Enter() { SetStateTo(GameStateType.GS_Continue); IGuideMidMatchTip.Instance.RegisterListerner(); switch (PlayerManager.Instance.LocalAccount.ObType) { case ObPlayerOrPlayer.PlayerType: GamePlayCtrl.Instance.Enter(); break; case ObPlayerOrPlayer.PlayerObType: mUIRoot = LoadUiResource.LoadRes(GameMethod.GetUiCamera.transform, GameConstDefine.LoadGameViewer); break; } JxBlGame.Instance.PlayStart(); CGLCtrl_GameLogic.Instance.AskLoadComplete(); ResourceUnit clipUnit = ResourcesManager.Instance.loadImmediate(AudioDefine.GetMapBgAudio((MAPTYPE)GameUserModel.Instance.GameMapID), ResourceType.ASSET); AudioClip clip = clipUnit.Asset as AudioClip; AudioManager.Instance.PlayBgAudio(clip); //正常流程 EventCenter.AddListener <UInt64>(EGameEvent.eGameEvent_GameOver, OnGameOver); //新手引导流程 EventCenter.AddListener <CEvent>(EGameEvent.eGameEvent_Loading, OnEvent); EventCenter.AddListener(EGameEvent.eGameEvent_ConnectServerFail, OnConnectServerFail); EventCenter.AddListener(EGameEvent.eGameEvent_SdkLogOff, SdkLogOff); EventCenter.AddListener(EGameEvent.eGameEvent_ReconnectToBatttle, OnReconnectToBatttle); //获取地图信息 GetMapType(); }
public void InitSenseTaskData() { switch ((int)GameUserModel.Instance.GameMapID)//记得改回去-2014-06-26 //switch (primaryGuideTaskMap) { case primaryGuideTaskMap: if (sceneGuideTask == null) { sceneGuideTask = new PrimaryGuideTask(); } break; case middleGuideTaskMap: break; } if (UINewsGuide.Instance == null) { LoadUiResource.LoadRes(GameMethod.GetUiCamera.transform, guideUiPath); } sceneGuideTask.InitSceneTaskData(); }
/// <summary> /// 初始化有强制的UI引导 /// </summary> private void InitGuideGroundBtn(int taskId) { GuideTaskInfo info = ConfigReader.GuideTaskXmlInfoDict[taskId]; string name = info.BtnName; GuideEventButton = UIGuideModel.Instance.GetUiGuideButtonGameObject(name); if (GuideEventButton == null) { return; } LocalParent = GuideEventButton.transform.parent.gameObject; GuideEventButton.transform.parent = mRoot.transform; GuideEventButton.SetActive(false); GuideEventButton.SetActive(true); GameObject obj = LoadUiResource.LoadRes(mRoot, "Guide/" + info.PrefabName); obj.transform.Find("Label").GetComponent <UILabel>().text = info.Text; obj.transform.localPosition = info.PosXYZ; ButtonOnPress ck = GuideEventButton.AddComponent <ButtonOnPress>(); ck.AddListener(taskId, OnUiGuideBtnFinishEvent, ButtonOnPress.EventType.ClickType); }
//创建窗体 private bool Create() { if (mRoot) { Debug.LogError("Window Create Error Exist!"); return(false); } if (mResName == null || mResName == "") { Debug.LogError("Window Create Error ResName is empty!"); return(false); } Transform canvas = GameUtils.GetCanvas(); if (canvas == null) { Debug.LogError("Window Create Error canvas is empty! WindowName = " + mResName); return(false); } GameObject obj = LoadUiResource.LoadRes(canvas, mResName); if (obj == null) { Debug.LogError("Window Create Error LoadRes WindowName = " + mResName); return(false); } mRoot = obj.transform; mRoot.gameObject.SetActive(false); return(true); }
public GameObject CreateParentPrefab() { return(LoadUiResource.LoadRes(GameMethod.GetUiCamera.transform, parentPath)); }