Пример #1
0
        private void CreateDrawable()
        {
            Dispose();

            var laser = this.laserReference.Object as Laser;

            if (laser.Next == null)
            {
                return;
            }

            var laserRoot = laser.Root.Object as LaserRoot;
            var nextLaser = laser.Next?.Object as Laser;

            float  x0       = laser.HorizontalPosition;
            float  x1       = nextLaser.HorizontalPosition;
            double duration = laser.Next.AbsolutePosition - laserReference.AbsolutePosition;

            Drawable = new LaserDrawable(Renderer, laserReference, ConvertLaserPosition(x0), ConvertLaserPosition(x1),
                                         (float)(duration / Renderer.ViewDuration))
            {
                Texture      = Renderer.LaserTexture,
                Colour       = Renderer.LaserColors[laserRoot.Index],
                Alpha        = 0.7f,
                BlendingMode = BlendingMode.Additive,
            };

            Renderer.PlayFieldContainer.Add(Drawable);
        }
Пример #2
0
        public override Drawable Clone()
        {
            LaserDrawable clone = (LaserDrawable)base.Clone();

            clone.texture = texture;

            return(clone);
        }