//********************************** Banshee Engine (www.banshee3d.com) **************************************************// //**************** Copyright (c) 2016 Marko Pintera (marko.pintera@gmail.com). All rights reserved. **********************// using System.Runtime.CompilerServices; namespace BansheeEngine { /** @addtogroup Resources * @{ */ /// /// Base class for all user-defined managed resources. Managed resources are automatically serialized, can be saved /// and persistently referenced by other objects. /// public class ManagedResource : Resource { /// /// Constructor for internal use by the runtime. /// protected ManagedResource() { } /// /// Creates a new managed resource. /// /// Type of the managed resource to create. /// A new instance of a managed resource with default values. static public T Create() where T : ManagedResource, new() { T newResource = new T(); Internal_CreateInstance(newResource); return newResource; } [MethodImpl(MethodImplOptions.InternalCall)] private static extern void Internal_CreateInstance(ManagedResource resource); } /** @} */ }