public static void PopulateIDRelation(ClassData ClassData, FieldData fieldData, MonoBehaviour mono, bool UseInstance = false) { if (UseInstance) { fieldData.AddRuntimeReference(mono); } if (MonoToID.ContainsKey(mono)) { fieldData.AddID(MonoToID[mono]); fieldData.RemoveRuntimeReference(mono); } else { UnserialisedObjectReferences.Add(new Tuple <MonoBehaviour, FieldData>(mono, fieldData)); } FieldsToRefresh.Add(fieldData); ClassData.Data.Add(fieldData); }