public void SetStorage(object provider, object storeValue, PropertyInfo pi, ResourceOperationContext context) { ResourceReference[] references = (ResourceReference[])storeValue; ICollection <T> collection = (ICollection <T>)pi.GetValue(provider); var referenceManager = context.ReferenceManager; if (referenceManager == null) { Debug.Assert(referenceManager != null); } for (int index = 0; index < references.Length; index++) { var refe = references[index]; if (refe != null) { collection.Add((T)referenceManager.GetResource(refe, context)); } } }
public object GetStorage(object provider, object value, PropertyInfo pi, ResourceOperationContext context) { T[] collection = (T[])value; var references = new ResourceReference[collection.Length]; int i = 0; var referenceManager = context.ReferenceManager; if (referenceManager == null) { Debug.Assert(referenceManager != null); } foreach (var item in collection) { if (item != null) { references[i++] = referenceManager.GetReference(item, context); } } return(references); }
public void SetStorage(object provider, object storeValue, PropertyInfo pi, ResourceOperationContext context) { ResourceReference[] referenes = (ResourceReference[])storeValue; T[] array = new T[referenes.Length]; var referenceManager = context.ReferenceManager; if (referenceManager == null) { Debug.Assert(referenceManager != null); } for (int i = 0; i < referenes.Length; i++) { if (referenes[i] != null) { array[i] = (T)referenceManager.GetResource(referenes[i], context); } } array = array.Where(x => x != null).ToArray(); pi.SetValue(provider, array); }
public object GetStorage(object provider, object propValue, System.Reflection.PropertyInfo pi, ResourceOperationContext context) { StateStore state = new StateStore(propValue); return(state); }
public void SetStorage(object provider, object storeValue, System.Reflection.PropertyInfo pi, ResourceOperationContext context) { StateStore state = (StateStore)storeValue; var obj = pi.GetValue(provider); state.Restore(obj); }
public object OnCreateResource(ResourceOperationContext context) { return(new SkyDome()); }
public void OnAssetCreated(object provider, ResourceOperationContext context) { }
public object OnCreateResource(ResourceOperationContext context) { return(null); }
public object OnCreateResource(ResourceOperationContext context) { return(new Mesh(VertexDescriptor.GetDescriptor(_vertexType))); }
public void OnAssetCreated(object provider, ResourceOperationContext context) { var mesh = (Mesh)provider; _vertexType = mesh.VertexDescriptor.VertexType; }
public void SetStorage(object provider, object storeValue, System.Reflection.PropertyInfo pi, ResourceOperationContext context) { Data data = (Data)storeValue; var mesh = (Mesh)provider; mesh.CreateIndexBuffer(data.Buffer, data.SixteenBits?IndexFormat.Index16: IndexFormat.Index32); }
public object GetStorage(object provider, object propValue, System.Reflection.PropertyInfo pi, ResourceOperationContext context) { var ibuffer = (GraphicBuffer)propValue; byte[] buffer = ibuffer.ToArray <byte>(); return(new Data { Buffer = buffer, SixteenBits = ibuffer.Stride == 2 }); }
public void SetStorage(object provider, object storeValue, System.Reflection.PropertyInfo pi, ResourceOperationContext context) { byte[] vbuffer = (byte[])storeValue; var mesh = (Mesh)provider; mesh.CreateVertexBuffer(vbuffer); }
public object GetStorage(object provider, object propValue, System.Reflection.PropertyInfo pi, ResourceOperationContext context) { var vb = (GraphicBuffer)propValue; byte[] vbuffer = vb.ToArray <byte>(); return(vbuffer); }