示例#1
0
        private static void InstantiateAndPlaySoundEffectInstance(LimitedInstancingSoundEffectBehaviour effectPrefab, int index)
        {
            LimitedInstancingSoundEffectBehaviour behaviour = Instantiate <LimitedInstancingSoundEffectBehaviour>(effectPrefab);

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