Ejemplo n.º 1
0
        private static void InstantiateAndPlaySoundEffectInstance(LimitedInstancingSoundEffectBehaviour effectPrefab, int index)
        {
            LimitedInstancingSoundEffectBehaviour behaviour = Instantiate <LimitedInstancingSoundEffectBehaviour>(effectPrefab);

            DontDestroyOnLoad(behaviour.gameObject);
            behaviour.Play(index);
        }
Ejemplo n.º 2
0
 protected static bool CreateSoundEffectInstance(LimitedInstancingSoundEffectBehaviour effectPrefab, int index, float minTimeForPlayingSec)
 {
     if (!CanInstantiateSoundEffect(index, minTimeForPlayingSec))
     {
         return(false);
     }
     InstantiateAndPlaySoundEffectInstance(effectPrefab, index);
     return(true);
 }