| | |
| | | m_Right = this.GetComponent<Button>("Pivot/Container_Buttons/Btn_Right"); |
| | | m_Close = this.GetComponent<Button>("Pivot/Container_Buttons/Btn_Close"); |
| | | |
| | | m_SubWindowContainer = this.GetComponent<RectTransform>("Container_SubWindow"); |
| | | m_SubWindowContainer = this.GetComponent<RectTransform>("Pivot/Container_SubWindow"); |
| | | |
| | | var name = this.GetType().Name; |
| | | var children = WindowConfig.GetChildWindows(name); |
| | | foreach (var child in children) |
| | | { |
| | | var info = WindowConfig.GetWindowFunctionInfo(name, child); |
| | | m_Group.AddFunction(info.order, info.functionId, Language.Get(info.titleKey), info.redPointId); |
| | | m_Group.AddFunction("FunctionButton_Pattern_1", info.order, info.functionId, Language.Get(info.titleKey), info.redPointId); |
| | | } |
| | | |
| | | m_TitleIcon.SetSprite(WindowConfig.GetTitleIconKey(name)); |
| | |
| | | protected override void OnActived() |
| | | { |
| | | base.OnActived(); |
| | | |
| | | m_Group.TriggerByOrder(functionOrder); |
| | | m_Left.gameObject.SetActive(m_Group.unLockedCount > 1); |
| | | m_Right.gameObject.SetActive(m_Group.unLockedCount > 1); |
| | | } |
| | |
| | | {
|
| | | if (!initialized)
|
| | | {
|
| | | AddWindowPattern();
|
| | |
|
| | | if (windowInfo.clickEmptyToClose && emptyCloseButton == null)
|
| | | {
|
| | | AddEmptyCloseResponser();
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void AddWindowPattern()
|
| | | {
|
| | | var pattern = WindowConfig.GetWindowPattern(this.GetType().Name);
|
| | | if (!string.IsNullOrEmpty(pattern))
|
| | | {
|
| | | var instance = UIUtility.CreateWidget(pattern, "Pivot");
|
| | | instance.transform.SetParentEx(this.transform, Vector3.zero, Quaternion.identity, Vector3.one);
|
| | | }
|
| | | }
|
| | |
|
| | | private void AddEmptyCloseResponser()
|
| | | {
|
| | | var emptyClose = UIUtility.CreateWidget("InvisibleButton", "EmptyClose");
|
| | |
| | | return a < b ? -1 : 1; |
| | | } |
| | | |
| | | public FunctionButton AddFunction(int order, int functionId, string title, int redpointId) |
| | | public FunctionButton AddFunction(string pattern, int order, int functionId, string title, int redpointId) |
| | | { |
| | | if (m_Container == null) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | var instance = UIUtility.CreateWidget("FunctionButton", string.Concat("Function_", order)); |
| | | var instance = UIUtility.CreateWidget(pattern, string.Concat("Function_", order)); |
| | | instance.transform.SetParentEx(this.m_Container, Vector3.zero, Quaternion.identity, Vector3.one); |
| | | |
| | | var functionButton = instance.GetComponent<FunctionButton>(); |
| | | functionButton.functionId = functionId; |
| | | functionButton.order = order; |