//Data 리턴 public T GetData <T>(GameEnums.dataType type, int index) where T : RawData { T data; Debug.LogFormat("데이터리턴 : {0}", type); var checkKey = dicDatas.ContainsKey(type); if (checkKey == false) { Debug.LogFormat("<color=red> Key Error!!! </color>"); return(null); } else { data = (T)this.dicDatas[type][index]; } return(data); }
//Dictionary 리턴 public Dictionary <int, T> GetData <T>(GameEnums.dataType type) where T : RawData { Dictionary <int, T> dicTemp = new Dictionary <int, T>(); var checkKey = this.dicDatas.ContainsKey(type); Debug.LogFormat("딕셔너리리턴 : {0}", type); if (checkKey == false) { Debug.LogFormat("<color=red> Key Error!!! </color>"); return(null); } else { foreach (var data in this.dicDatas[type]) { dicTemp.Add(data.Key, (T)data.Value); } } return(dicTemp); }