예제 #1
0
        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);
        }
예제 #2
0
        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));
        }
예제 #3
0
 protected void SetSerializedDataArgumentInstance(object value)
 {
     m_SerializedDataArgument = ArgumentCacheEx.ToJson(value);
     m_SerializedDataArgumentAssemblyTypeName = value != null?value.GetType().AssemblyQualifiedName : string.Empty;
 }