public void Initialize() { if (frontGround == null) { frontGround = GameObject.Find("FrontGround").GetComponent <Image>(); } if (IntroUI == null) { IntroUI = GameObject.FindObjectOfType <UIIntro>(); } if (LoadingUI == null) { LoadingUI = GameObject.FindObjectOfType <UILoading>(); } if (TimerUI == null) { TimerUI = GameObject.FindObjectOfType <UITimer>(); } if (ScoreUI == null) { ScoreUI = GameObject.FindObjectOfType <UIScore>(); } if (ResultUI == null) { ResultUI = GameObject.FindObjectOfType <UIResult>(); } IntroUI.Initialize(this); LoadingUI.Initialize(this); TimerUI.Initialize(this); ScoreUI.Initialize(this); ResultUI.Initialize(this); }
public void ChangeScene(string name, bool needLoading = true) { if (needLoading) { UILoading.LoadSceneAsync(name); } }
private void OnLoadUILoading() { UILoading.subTitle = "正在加载,请耐心等待"; UILoading.ShowLoading(); isInit = true; LoadNeedRes(); }
public void ChangeScene(string name) { if (true == string.IsNullOrEmpty(name)) { return; } AssetManager.Instance.DestroyAll(); //화면 다 없앰 UIManager.Instance.ClearUI(); //UI 관리 레이어 클리어 #region fade UIFade ui = UIManager.Instance.Open("UIFade") as UIFade; ui.m_openCallback = () => { m_loading = UIManager.Instance.Open("UILoading") as UILoading; m_loading.transform.SetAsFirstSibling(); }; ui.m_closeCallback = () => { StartCoroutine(StartChangeScene(name)); }; #endregion }
public UIMgr() { uiList = new Dictionary <string, UIBase>(); outTouchList = new List <UIBase>(); removeList = new List <UIBase>(); recordList = new List <UIBase>(); uiSorterMgr = new UISorterMgr(1, 8000); InitRegisterHandler(); HUDTopBoardRoot = new GameObject("HUDTopBoardRoot"); HUDTopBoardRoot.transform.SetParent(GUIHelper.GetUIRootObj().transform, false); HUDTopBoardRoot.layer = LayerMask.NameToLayer("UI"); var canvas = HUDTopBoardRoot.AddComponent <Canvas>(); canvas.overrideSorting = true; canvas.sortingOrder = GUIHelper.GetUIRoot().sortingOrder - 2; HUDTopBoradCache = new GameObject("HUDTopBoradCache"); GameObject.DontDestroyOnLoad(HUDTopBoradCache); HUDTopBoradCache.SetActive(false); /*---------------UI界面控制脚本添加-------------------*/ UIBase ui = new UILogin(100, UILevel.Level1); uiList.Add("UILogin", ui); ui = new UILoading(101, UILevel.Common); uiList.Add("UILoading", ui); }
//========================================================================================== #region UILoading管理 public UILoading OpenLoading(string name, object arg = null) { Debuger.Log(name); UILoading ui = Open <UILoading>(name, arg); return(ui); }
private void DownLoadCompleteAll() { UILoading.CloseLoading(); if (callBack != null) { callBack(m_kScenePrefab); } }
private void OnCompleteLoaded() { showProgress = false; UILoading.CloseLoading(); setUIRoot(); //TestPanel.Instance.load(); SoundMgr._instance.bgmPlay("beijing_dating" + GameConst.BGM, GameConst.musicVol); LoginPanel.Instance.load(); }
protected override void InitComponents() { sinstance = this; TextContent = FindWidget <Text>("TextContent"); TextContent.text = ""; Progress = FindWidget <Image>("SliderProgress"); Progress.fillAmount = 0; }
void Awake() { Instance = this; RemoveMessage(this, MessageList); RegisterMessage(this, MessageList); var rect = m_progressBar.transform.parent.GetComponent <RectTransform>(); m_progressWidth = rect.sizeDelta.x; }
public void SetLoadingPanelInfo(string currentPageName, string nextPageName) { UILoading widget = m_widgetRepositories.FindWidget("UILoading") as UILoading; if (widget != null) { widget.SetLoadingPanelInfo(currentPageName, nextPageName); } }
public void SetLoadingProgressInfo(float progress) { UILoading widget = m_widgetRepositories.FindWidget("UILoading") as UILoading; if (widget != null) { widget.SetLoadingProgressInfo(progress); } }
public void HideLoadingWidget(float deactiveTime = 0.0f) { UILoading widget = m_widgetRepositories.FindWidget("UILoading") as UILoading; if (widget != null) { widget.Hide(deactiveTime); } }
void OnDestroy() { uiPlay = null; uiMenu = null; uiTitle = null; uiLoading = null; uiSystemPopup = null; popupPaused = null; instance = null; }
public override void Enter() { base.Enter(); GLCommand ev = Cmd as GLCommand; mLoadingSceneId = ev.SceneID; UIManage.Instance.Clear(); UIManage.Instance.OpenWindow(WindowID.UI_LOADING); mLoadingWindow = (UILoading)UIManage.Instance.GetWindow(WindowID.UI_LOADING); }
private void Init() { _instance = this; mTransform = transform; bar = mTransform.Find("bar").GetComponent <Image>(); transformBarHead = mTransform.Find("bar/bar_head"); text_tip = mTransform.Find("text_tip").GetComponent <Text>(); SetBarProgress(0); gameObject.SetActive(false); }
public void CloseLoading(string name, object arg = null) { Debuger.Log(name); UILoading ui = GetUI(name) as UILoading; if (ui != null) { ui.Close(arg); } }
static public UILoading GetInstance() { UILoading self = UIManager.Singleton.GetUIWithoutLoad <UILoading>(); if (self != null) { return(self); } self = UIManager.Singleton.LoadUI <UILoading>("UI/UILoading", UIManager.Anchor.Center); return(self); }
/// <summary> /// Awake this instance. /// </summary> void Awake() { LoadingUI = UISystem.GetSingleton().LoadWidget<UILoading>(ResourceDef.UI_LOADING, false); if (!LoadingUI) throw new System.NullReferenceException(); SubscribeEvent(CmdEvent.CMD_SCENE_LOADSTART, OnSceneStart); SubscribeEvent(CmdEvent.CMD_SCENE_LOADING, OnSceneLoading); SubscribeEvent(CmdEvent.CMD_SCENE_LOADFINISH, OnSceneFinished); SubscribeEvent(CmdEvent.CMD_SCENE_TRIGGER, OnSceneTrigger); }
public UILoading ShowLoading() { if (mLoading != null) { return(mLoading); } mLoading = ResourceManager.New <UILoading>(string.Format("UI/{0}", GetNameFromType(typeof(UILoading)))); U3DMod.AddChild(uiRoot, mLoading.gameObject); mLoading.progresPersent = 0; return(mLoading); }
public void Uninitialize() { if (isInitialized) { if (_ui != null) { _ui.Uninitialize(); _ui = null; } isInitialized = false; } }
public void Initialize() { if (_ui == null) { _ui = new UILoading(); } goUI = GameSystem.Instance.mClient.mUIManager.CreateUI("Prefab/GUI/UILoading"); _ui.Initialize(goUI); Scheduler.Instance.AddUpdator(Update); GameSystem.Instance.showLoading = true; isInitialized = true; string str = GameSystem.Instance.CommonConfig.GetString("gLoadingBg"); string[] items = str.Split('&'); int nt = 0; Dictionary <int, string> bgDic = new Dictionary <int, string>(); List <int> bgList = new List <int>(); foreach (string item in items) { string[] info = item.Split(':'); string bg = info[0]; int weight = int.Parse(info[1]); if (weight == 0) { continue; } nt += weight; bgDic.Add(nt, bg); bgList.Add(nt); } int randNum = UnityEngine.Random.Range(1, nt); int key = -1; for (int i = 0; i < bgList.Count; i++) { if (randNum <= bgList[i]) { key = bgList[i]; break; } } string bgStr = bgDic[key]; _ui._bg.mainTexture = ResourceLoadManager.Instance.GetResources("Texture/" + bgStr, true) as Texture; }
static int set_Instance(IntPtr L) { try { UILoading arg0 = (UILoading)ToLua.CheckUnityObject(L, 2, typeof(UILoading)); UILoading.Instance = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
private void ShowLoadingBar() { UILoading.subTitle = "正在加载中,请耐心等待,<color=yellow>(此加载不消耗流量)</color>"; UILoading.ShowLoading(); gameObject.AddComponent <ResourceMgr>(); ResourceMgr.Instance.InitFunc = () => { otherStep++; OnNeedResLoaded(new object()); ResourceMgr.Instance.DownLoadBundles(URLConst.listInitGameRes.ToArray(), OnNeedResLoaded, ResourceMgr.DEFAULT_PRIORITY, OnDownLoadCallBack); }; }
static int LoadEnd(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); UILoading obj = (UILoading)ToLua.CheckObject(L, 1, typeof(UILoading)); obj.LoadEnd(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int OpenLoading(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); UILoading obj = (UILoading)ToLua.CheckObject <UILoading>(L, 1); obj.OpenLoading(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int UpdateDownload(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); UILoading obj = (UILoading)ToLua.CheckObject(L, 1, typeof(UILoading)); string arg0 = ToLua.CheckString(L, 2); obj.UpdateDownload(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int OnMessage(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); UILoading obj = (UILoading)ToLua.CheckObject(L, 1, typeof(UILoading)); IMessage arg0 = (IMessage)ToLua.CheckObject(L, 2, typeof(IMessage)); obj.OnMessage(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
public void ShowLoadingWidget(float activeTime = 0.0f, string currentPageName = "", string nextPageName = "") { UILoading widget = m_widgetRepositories.FindWidget("UILoading") as UILoading; if (widget == null) { widget = m_widgetRepositories.CreateWidget <UILoading>("UI/Prefabs/System/UILoading"); } if (widget != null) { widget.Show(activeTime); widget.SetLoadingPanelInfo(currentPageName, nextPageName); widget.SetLoadingProgressInfo(0.0f); } }
static int set_m_desc(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UILoading obj = (UILoading)o; UI.TextEx arg0 = (UI.TextEx)ToLua.CheckUnityObject(L, 2, typeof(UI.TextEx)); obj.m_desc = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index m_desc on a nil value" : e.Message)); } }
static int get_m_desc(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UILoading obj = (UILoading)o; UI.TextEx ret = obj.m_desc; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index m_desc on a nil value" : e.Message)); } }
private void Init() { _instance = this; mTransform = transform; bar = mTransform.Find("bar").GetComponent<Image>(); transformBarHead = mTransform.Find("bar/bar_head"); text_tip = mTransform.Find("text_tip").GetComponent<Text>(); SetBarProgress(0); gameObject.SetActive(false); }
/// <summary> /// Awake this instance. /// </summary> void Awake() { LoadUI = UISystem.GetSingleton().LoadWidget<UILoading>(ResourceDef.UI_LOADING, false); }
/// <summary> /// Active this instance. /// </summary> public override void Active() { if (!LoadUI) LoadUI = UISystem.GetSingleton().LoadWidget<UILoading>(ResourceDef.UI_LOADING); }