protected void RegisterSerializedObjectPersistentListener(int index, UnityEngine.Object targetObj, Type targetObjType, object data, string methodName) { var listener = GetListener(index); listener.RegisterPersistentListener(targetObj, targetObjType, methodName); listener.mode = PersistentListenerMode.String; listener.arguments.serializedDataArgument = ArgumentCacheEx.ToJson(data); }
protected object GetSerializedDataArgumentInstance() { var type = GetSerializedDataType(); if (string.IsNullOrEmpty(m_SerializedDataArgument)) { if (type.IsValueType) { return(Activator.CreateInstance(type)); } return(null); } return(ArgumentCacheEx.FromJson(m_SerializedDataArgument, type)); }
protected void SetSerializedDataArgumentInstance(object value) { m_SerializedDataArgument = ArgumentCacheEx.ToJson(value); m_SerializedDataArgumentAssemblyTypeName = value != null?value.GetType().AssemblyQualifiedName : string.Empty; }