Exemplo n.º 1
0
        public static void Set(EntityBase entity, Material mat, int slot = 0)
        {
            #if !(RELEASE && RELEASE_DISABLE_CHECKS)
            if (entity == null)
                throw new ArgumentNullException("entity");
            if (mat == null)
                throw new ArgumentNullException("mat");
            #endif

            NativeMaterialMethods.SetMaterial(entity.GetEntityHandle(), mat.Handle, slot);
        }
Exemplo n.º 2
0
        public static Material Get(EntityBase entity, int slot = 0)
        {
            #if !(RELEASE && RELEASE_DISABLE_CHECKS)
            if (entity == null)
                throw new ArgumentNullException("entity");
            #endif

            var ptr = NativeMaterialMethods.GetMaterial(entity.GetEntityHandle(), slot);
            return TryAdd(ptr);
        }