예제 #1
0
파일: Decoder.cs 프로젝트: NeatWolf/Tools
        public static T Decode <T>(this string data, ref T val, ICfgSerializeNestedReferences referencesKeeper) where T : UnityEngine.Object
        {
            if (referencesKeeper == null)
            {
                return(val);
            }

            var ind = data.ToInt();

            var getting = referencesKeeper.GetReferenced <T>(ind);

            if (getting != null)
            {
                val = getting;
            }

            return(val);
        }
예제 #2
0
파일: Decoder.cs 프로젝트: NeatWolf/Tools
        public static List <T> Decode_References <T>(this string data, out List <T> list, ICfgSerializeNestedReferences referencesKeeper) where T : UnityEngine.Object
        {
            list = new List <T>();

            if (referencesKeeper == null)
            {
                return(list);
            }

            List <int> indexes;

            data.Decode_List(out indexes);

            foreach (var i in indexes)
            {
                list.Add(referencesKeeper.GetReferenced <T>(i));
            }

            return(list);
        }