| | |
| | | { |
| | | |
| | | public WindowTable[] windows; |
| | | public Dictionary<string, List<string>> parentChildrenTable = new Dictionary<string, List<string>>(); |
| | | public List<string> childWindows = new List<string>(); |
| | | |
| | | static WindowConfig config; |
| | | public static WindowConfig Get()
|
| | |
| | | if (config == null)
|
| | | {
|
| | | config = Resources.Load<WindowConfig>("ScriptableObject/Config/WindowConfig");
|
| | | for (int i = 0; i < config.windows.Length; i++)
|
| | | {
|
| | | var table = config.windows[i];
|
| | | var children = config.parentChildrenTable[table.parent] = new List<string>();
|
| | | for (int j = 0; j < table.orderTables.Length; j++)
|
| | | {
|
| | | children.Add(table.orderTables[j].window);
|
| | | }
|
| | |
|
| | | config.childWindows.AddRange(children);
|
| | | }
|
| | | }
|
| | |
|
| | | return config;
|
| | | } |
| | | |
| | | |
| | | public bool FindChildWindow(string _parent, int _order, out string _child)
|
| | | {
|
| | |
| | | return false;
|
| | | } |
| | | |
| | | public List<string> FindChildWindows(string _parent)
|
| | | {
|
| | | if (parentChildrenTable.ContainsKey(_parent))
|
| | | {
|
| | | return parentChildrenTable[_parent];
|
| | | }
|
| | | else
|
| | | {
|
| | | return null;
|
| | | }
|
| | | } |
| | | |
| | | public bool IsChildWindow(string _name)
|
| | | {
|
| | | return childWindows.Contains(_name);
|
| | | } |
| | | |
| | | [Serializable] |
| | | public struct WindowTable
|
| | | {
|