コード例 #1
0
ファイル: IParticle.cs プロジェクト: fernung/Rysys
 public Particle(Texture2D texture, Vector2 position, Color tint, float duration, Vector2 scale, ParticleState state, float theta = 0) : base(position, scale, theta)
 {
     Texture  = texture;
     Tint     = tint;
     Duration = duration;
     LifeTime = 1.0f;
     State    = state;
 }
コード例 #2
0
ファイル: IParticle.cs プロジェクト: fernung/Rysys
 public void Set(Texture2D texture, Vector2 position, Color tint, float duration, Vector2 scale, ParticleState state, float theta = 0)
 {
     Texture     = texture;
     Position    = position;
     Tint        = tint;
     Duration    = duration;
     Scale       = scale;
     LifeTime    = 1.0f;
     State       = state;
     Orientation = theta;
 }
コード例 #3
0
ファイル: ParticleManager.cs プロジェクト: fernung/Rysys
        public void Create(Texture2D texture, Vector2 position, Color tint, float duration, Vector2 scale, ParticleState state, float theta = 0.0f)
        {
            Particle p;

            if (Particles.Count == Particles.Capacity)
            {
                p = Particles[0];
                Particles.Start++;
            }
            else
            {
                p = Particles[Particles.Count];
                Particles.Count++;
            }

            p.Set(texture, position, tint, duration, scale, state, theta);
        }