コード例 #1
0
 public ExplosionEffect(Vec2 Position)
     : base(Position)
 {
     Explosion = (ParticleExplosion <PixelParticle>) new ParticleExplosion <PixelParticle>(15, 0.3, Position)
                 .SetParticleInitAction((PixelParticle p) =>
     {
         p.Color = Color.Red;
         p.Acc   = 2200;
         p.Speed = 1500;
     })
                 .SetParticleUpdateAction((PixelParticle p) =>
     {
         if (p.Time < 0.1)
         {
             p.Color = new Color(p.Color.R, p.Color.G, p.Color.B, p.Time * 10);
         }
         else if (p.Time > 0.20)
         {
             p.Color = new Color(p.Color.R, p.Color.G, p.Color.B, 1 - (p.Time - 0.20) * 10);
         }
     });
 }
コード例 #2
0
ファイル: LegacyJudgementPieceNew.cs プロジェクト: Wieku/osu
        public LegacyJudgementPieceNew(HitResult result, Func <Drawable> createMainDrawable, Texture particleTexture)
        {
            this.result = result;

            AutoSizeAxes = Axes.Both;
            Origin       = Anchor.Centre;

            InternalChildren = new[]
            {
                mainPiece = createMainDrawable().With(d =>
                {
                    d.Anchor = Anchor.Centre;
                    d.Origin = Anchor.Centre;
                })
            };

            if (particleTexture != null)
            {
                AddInternal(particles = new ParticleExplosion(particleTexture, 150, 1600)
                {
                    Size   = new Vector2(140),
                    Depth  = float.MaxValue,
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                });
            }

            if (result != HitResult.Miss)
            {
                //new judgement shows old as a temporary effect
                AddInternal(temporaryOldStyle = new LegacyJudgementPieceOld(result, createMainDrawable, 1.05f)
                {
                    Blending = BlendingParameters.Additive,
                    Anchor   = Anchor.Centre,
                    Origin   = Anchor.Centre,
                });
            }
        }
コード例 #3
0
ファイル: PlayerHitbox.cs プロジェクト: Kryxzael/RoomShuffle
 protected override void Awake()
 {
     base.Awake();
     _exploder         = GetComponent <ParticleExplosion>();
     _multiSoundPlayer = GetComponent <MultiSoundPlayer>();
 }