public void InstantiateUI(UI _ui, Transform _parentTr, UIData uData = null) { GameObject CloneUI = ObjectPoolManager.Getinstance.Get_ObjectUI(_ui.ToString()).gameObject; ObjectPoolManager.Getinstance.SetTransformParent_ObjectUI(_ui.ToString(), CanvasTr); UI_Base _uibase = CloneUI.GetComponent <UI_Base>(); if (uData != null) { _uibase.Set_BaseData(uData); } if (!Dic_UI_SaveObject.ContainsKey(_ui)) { Dic_UI_SaveObject[_ui] = CloneUI; Dic_UILst.Add(_ui, _uibase); Dic_UILst[_ui].set_Open(); } else { Dic_UILst.Add(_ui, _uibase); //Dic_UILst[_ui].set_Open(); Dic_UILst[_ui].set_refresh(); } UserEditor.Getsingleton.EditLog("complete creat " + _ui); }// end of function
}// end of function public UI_Base InstantiateUI(UIITEM _uiItem, Transform _parentTr) { GameObject orinUI = ObjectPoolManager.Getinstance.Get_ObjectUI(_uiItem.ToString()).gameObject; GameObject CloneUI = Instantiate(orinUI); CloneUI.transform.SetParent(_parentTr); RectTransform _cloneUIRectTr = CloneUI.GetComponent <RectTransform>(); RectTransform _newUIRectTr = orinUI.GetComponent <RectTransform>(); _cloneUIRectTr.sizeDelta = _newUIRectTr.sizeDelta; _cloneUIRectTr.anchoredPosition = _newUIRectTr.anchoredPosition; _cloneUIRectTr.localScale = _newUIRectTr.localScale; UI_Base _uibase = CloneUI.GetComponent <UI_Base>(); //Lst_UiItem.Add(_uibase); _uibase.set_Open(); return(_uibase); //Dic_UIunit.Add(_uiunit, _uibase); //Dic_UIunit[_uiunit].set_Open(); } // end of function
//: UI uinit 생성 public UI_Base CreatUI(UIITEM _uiItem, Transform _parentTr) { UI_Base _uibase = null; switch (_uiItem) { case UIITEM.ITEM_COMBATINFO: case UIITEM.ITEM_LEAGUEUNIT: case UIITEM.ITEM_UNIT: case UIITEM.ITEM_CLANMEMBERELEMENT: case UIITEM.ITEM_CLANBOARDELEMENT: case UIITEM.ITEM_RANKINGELEMENT: case UIITEM.ITEM_FRIENDELEMENT: case UIITEM.ITEM_NEWSELEMENT: case UIITEM.ITEM_GAINITEM: case UIITEM.ITEM_STOREELEMENT: case UIITEM.ITEM_STOREPACKAGEELEMENT: case UIITEM.ITEM_CLANMARKLIST: case UIITEM.ITEM_QUESTELEMENT: case UIITEM.ITEM_CHATELEMENT: case UIITEM.ITEM_EQUIPITEM: case UIITEM.ITEM_CLANLISTELEMENT: case UIITEM.ITEM_GAMEINVITEELEMENT: case UIITEM.ITEM_RESULTUNITSLOT: _uibase = InstantiateUI(_uiItem, _parentTr); break; } return(_uibase); }
UI_Base GOGetter(GameObject go, bool tryPar = false) { UI_Base u = go.GetComponent <UI_Base>(); Selectable sel = go.GetComponent <Selectable>(); if (!sel) { if (!tryPar) { UI_Base t = GOGetter(go.transform.parent.gameObject, true); if (t) { return(t); } } } if (!u) { u = go.AddComponent <UI_Base>(); u.main = sel; } return(u); }
public override void OnShow(UI_Base _pre_ui, params object[] _args) { if (UIManager.Instance.WindowCountInStack > 1) { m_btn_return.gameObject.SetActive(true); } else { m_btn_return.gameObject.SetActive(false); } UI_Base cur = UIManager.Instance.GetCurrentWindow(); if (cur == null) { m_btn_menu.gameObject.SetActive(false); m_text_title_name.text = string.Empty; } else { m_text_title_name.text = cur.name; if (closeMenuList.Contains(cur.name)) { m_btn_menu.gameObject.SetActive(false); } else { m_btn_menu.gameObject.SetActive(true); } } }
public override float PreShow(UI_Base _pre_ui, params object[] _args) { //显示上次登陆的用户名 m_edit_account.text = LocalConfigSystem.Instacne.GetOptionConfig("CurrentAccount"); m_edit_password.text = LocalConfigSystem.Instacne.GetOptionConfig("CurrentPassword"); SignalSystem.Register(SignalId.Login_ForceLogin, _forceLogin); return(m_entrance_anim_time); }
// uiitem 하나만 삭제 public void RemoveUI_Item(UI_Base uiItem) { int idx = Lst_UiItem.IndexOf(uiItem); Destroy(Lst_UiItem[idx].gameObject); Lst_UiItem.Remove(uiItem); }
public void CloseSceneUI() { if (m_CurrentSceneUI != null) { ResourceManager.Instance.DestroyObject(m_CurrentSceneUI.gameObject); } m_Target = null; m_CurrentSceneUI = null; }
bool findgainItem(UI_Base a) { if (a != null) { return(true); } else { return(false); } }
public void Show(string name) { if (Current != null) { Current.UI_End(); Current.gameObject.SetActive(false); } UI_Datas[name].gameObject.SetActive(true); UI_Datas[name].UI_Start(); Current = UI_Datas[name]; }
private void Start() { var bases = FindObjectsOfType <UI_Base>(); foreach (var v in bases) { if (v.idfinder == id_UI_Base) { ui_to_open = v; } } }
private void SetUIInstance() { UI_Base[] uis = GetComponentsInChildren <UI_Base>(true); int len = uis.Length; for (int i = 0; i < len; i++) { UI_Base ui = uis[i]; string uiName = ui.name; _uiInstances.Add(uiName.ToUpper(), ui); ui.gameObject.SetActive(true); } }
// UI 오브젝트 얻기 public UI_Base Get_ObjectUI(string uiName) { UI_Base bases = null; if (Op_ObjectUI.IsContain(uiName)) { bases = Op_ObjectUI.Get_Object(uiName); } else { GameObject obj1 = Resources.Load(string.Format("Prefebs/UI_{0}", uiName)) as GameObject; Op_ObjectUI.Allocate(uiName, obj1.GetComponent <UI_Base>()); bases = Op_ObjectUI.Get_Object(uiName); } return(bases); }
public void ShowUIScene(E_SCENE_UI_TYPE type) { if (m_CurrentSceneUI != null && m_sceneType == type) { return; } m_sceneType = type; CloseSceneUI(); GameObject go = ResourceManager.Instance.instantiate <GameObject>("Prefabs/UI/Scene/" + type.ToString()); m_CurrentSceneUI = go.GetComponentInChildren <UI_Base>(); m_Target = null; if (m_CurrentSceneUI != null) { m_CurrentSceneUI.OnShowUp(); } }
private void FindAndSetQuestionPanel(QPattern pattern, QuestionUIInfo info) { HideAllQuestionPanels(); UIPanel = null; for (int i = 0; i < QuestionUIPanels.Count; i++) { if (QuestionUIPanels[i].Pattern == pattern) { UIPanel = QuestionUIPanels[i].Panel; break; } } if (UIPanel != null) { CurrentQuestionPanel = UIPanel; UIPanel.gameObject.Show(); UIPanel.SetUI(info); } }
HashSet <UI_Base> GetUITargets() { var ray = cam.ScreenPointToRay(mouseScreenCoords); Debug.DrawRay(ray.origin, ray.direction * 10, Color.yellow); List <RaycastResult> hits = new List <RaycastResult>(); gRay.Raycast(pD, hits); HashSet <UI_Base> uibT = new HashSet <UI_Base>(); for (int i = 0; i < hits.Count; i++) { var go = hits[i].gameObject; UI_Base u = GOGetter(go); uibT.Add(u); } return(uibT); }
public static void BindEvent(this GameObject go, Action <PointerEventData> _call, Define.UIEvent type = Define.UIEvent.Click) { UI_Base.BindEvent(go, _call, type); }
private void Awake() { ui_base = GetComponentInParent <UI_Base>(); }
private void Awake() { ui_base = GetComponentInParent <UI_Base>(); anim = GetComponent <Animator>(); }
public override float PreShow(UI_Base _pre_ui, params object[] _args) { SignalSystem.Register(SignalId.Chat_ReceiveChat, _receivePlayerChat); _updateChat(); return(m_entrance_anim_time); }
public override void OnHide(UI_Base _next_ui) { SignalSystem.Unregister(SignalId.Login_ForceLogin, _forceLogin); }
public override void OnHide(UI_Base _next_ui) { SignalSystem.Unregister(SignalId.Chat_ReceiveChat, _receivePlayerChat); }
public static void BindUIEvent(this GameObject go, Action <PointerEventData> action, Define.UIEvent type) { UI_Base.BindUIEvent(go, action, type); }
public override float PreShow(UI_Base _pre_ui, params object[] _args) { return(m_entrance_anim_time); }