private bool TryGetWindow <T> (int _id, out T _win) where T : WindowViewBase, new() { bool get = false; WindowViewBase windowBase = null; if (!windowDict.TryGetValue(_id, out windowBase)) { RefWindowConfig config = null; if (RefWindowConfig.TryGet(_id, out config)) { _win = new T(); windowDict[_id] = _win; get = true; } else { _win = null; get = false; } } else { _win = (T)windowBase; get = true; } return(get); }
static public bool TryGet(int _id, out RefWindowConfig _data) { bool successful = false; successful = RefDataManager.Instance.windowConfig.TryGetValue(_id, out _data); if (!successful) { WDebug.Log(string.Format("Failed to get RefWindowConfig data by id:<color=yellow>{0}</color> ", _id)); } return(successful); }