예제 #1
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.GetIEntity(), slot);
            return(TryGet(ptr));
        }
예제 #2
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.GetIEntity(), mat.Handle, slot);
        }
예제 #3
0
 public static void RemoveAll(EntityBase parent)
 {
     NativeEntityMethods.RemoveAllEntityLinks(parent.GetIEntity());
 }
예제 #4
0
 public static EntityLink Create(EntityBase parent, EntityBase slave, string linkName, Vec3?relativePos = null, Quat?relativeRot = null)
 {
     return(new EntityLink(NativeEntityMethods.AddEntityLink(parent.GetIEntity(), linkName, slave.Id, slave.GUID, relativeRot ?? Quat.Identity, relativePos ?? Vec3.Zero), parent));
 }
예제 #5
0
 public static void RemoveAll(EntityBase parent)
 {
     NativeEntityMethods.RemoveAllEntityLinks(parent.GetIEntity());
 }
예제 #6
0
 public static EntityLink Create(EntityBase parent, EntityBase slave, string linkName, Vec3? relativePos = null, Quat? relativeRot = null)
 {
     return new EntityLink(NativeEntityMethods.AddEntityLink(parent.GetIEntity(), linkName, slave.Id, relativeRot ?? Quat.Identity, relativePos ?? Vec3.Zero), parent);
 }
예제 #7
0
파일: Material.cs 프로젝트: RogierWV/315GR
        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.GetIEntity(), mat.Handle, slot);
        }
예제 #8
0
파일: Material.cs 프로젝트: RogierWV/315GR
        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.GetIEntity(), slot);
            return TryGet(ptr);
        }