public override void PlayAndDestroy() { if (factory.IsNull()) { DespawnSelf(); return; } if (isPlaying) { return; } if (!factory.ParticleFactory.IsNull()) { psObj = factory.ParticleFactory.Create(xform); PoolManager.SetOnDespawnedCallback(psObj.transform, OnParticleObjectDespawned); psObj.PlayAndDestroy(); } if (!factory.SoundFactory.IsNull()) { sndObj = factory.SoundFactory.Create(xform); PoolManager.SetOnDespawnedCallback(sndObj.transform, OnSoundObjectDespawned); sndObj.PlayAndDestroy(); } isPlaying = true; }
public void PlayOneShot() { if (!effectParams.IsNull()) { effectObj = effectParams.Create(transform); effectObj.PlayAndDestroy(); } }
void OnEnable() { if (!EffectParams.IsNull()) { effectObj = EffectParams.Create(transform); } effectObj.PlayAndDestroy(); }