Пример #1
0
        public WithVoxelUnloadBody(Actor self, WithVoxelUnloadBodyInfo info)
        {
            var body = self.Trait <BodyOrientation>();

            rv = self.Trait <RenderVoxels>();

            var idleModel = self.World.ModelCache.GetModelSequence(rv.Image, info.IdleSequence);

            modelAnimation = new ModelAnimation(idleModel, () => WVec.Zero,
                                                () => body.QuantizeOrientation(self, self.Orientation),
                                                () => Docked,
                                                () => 0, info.ShowShadow);

            rv.Add(modelAnimation);

            var unloadModel = self.World.ModelCache.GetModelSequence(rv.Image, info.UnloadSequence);

            rv.Add(new ModelAnimation(unloadModel, () => WVec.Zero,
                                      () => body.QuantizeOrientation(self, self.Orientation),
                                      () => !Docked,
                                      () => 0, info.ShowShadow));
        }