示例#1
0
 public virtual void removeEffector(SSParticleEffector effector)
 {
     if (effector.preRemoveHook != null)
     {
         for (int i = 0; i < _activeBlockLength; ++i)
         {
             if (isAlive(i))
             {
                 ushort effectorMask = (ushort)((int)_readElement(_effectorMasksHigh, i) << 8
                                                | (int)_readElement(_effectorMasksLow, i));
                 if (effector.effectorMaskCheck(effectorMask))
                 {
                     SSParticle particle = new SSParticle();
                     readParticle(i, particle);
                     effector.preRemoveHook(particle);
                     writeParticle(i, particle);
                 }
             }
         }
     }
     _effectors.Remove(effector);
 }
示例#2
0
 public virtual void addEffector(SSParticleEffector effector)
 {
     effector.reset();
     if (effector.preAddHook != null)
     {
         for (int i = 0; i < _activeBlockLength; ++i)
         {
             if (isAlive(i))
             {
                 ushort effectorMask = (ushort)((int)readData(_effectorMasksHigh, i) << 8
                                                | (int)readData(_effectorMasksLow, i));
                 if (effector.effectorMaskCheck(effectorMask))
                 {
                     SSParticle particle = new SSParticle();
                     readParticle(i, particle);
                     effector.preAddHook(particle);
                     writeParticle(i, particle);
                 }
             }
         }
     }
     _effectors.Add(effector);
 }
 public virtual void addEffector(SSParticleEffector effector)
 {
     effector.reset();
     _effectors.Add(effector);
 }