HasUserData() public method

Checks if a particle has a certain user data slot
public HasUserData ( int slotID ) : bool
slotID int the slot id obtained by MBEmitter.GetParticleUserDataID
return bool
 public override void OnBirth(MBParticle PT)
 {
     if (PT.HasUserData(mGameObjectSlotID)) {
         if (Source) {
             Transform ptobj = SpawnObject();
             ptobj.parent = Source.parent;
     #if UNITY_4_0
             ptobj.gameObject.SetActive(true);
     #else
             ptobj.gameObject.active = true;
     #endif
             PT.UserData[mGameObjectSlotID] = ptobj;
         }
     }
 }
    public override void OnBirth(MBParticle PT)
    {
        if (AnimatedBirth) {
             if (ParticleSystem.GlobalTime - mBirthLastTime >= mBirthStepTime) {
                 mBirthFrame = Advance(mBirthFrame, ref mBirthDir, BirthAnimRepeat, BirthAnimMode);
                 mBirthLastTime += mBirthStepTime;
             }
         }

         if (AnimatedLife && PT.HasUserData(mLifeLastTimeID) && PT.HasUserData(mLifeDirID))
         {
             PT.UserData[mLifeLastTimeID] = ParticleSystem.GlobalTime;
             PT.UserData[mLifeDirID] = LifetimeAnimDirection;
         }

         PT.ImageFrameIndex = mBirthFrame - 1;
    }
Esempio n. 3
0
 public override void OnBirth(MBParticle PT)
 {
     base.OnBirth(PT);
     if (!DelaySync && PT.HasUserData(mSlotID))
         PT.UserData[mSlotID] = 0f;
 }