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); }
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); }