コード例 #1
0
    public static SoundEffectRegistry instance()
    {
        if (soundEffectRegistry == null)
        {
            soundEffectRegistry = FindObjectOfType(typeof(SoundEffectRegistry)) as SoundEffectRegistry;
        }

        // If it is still null, create a new instance
        if (soundEffectRegistry == null)
        {
            GameObject obj = new GameObject("SoundEffectRegistry");
            soundEffectRegistry = obj.AddComponent(typeof(SoundEffectRegistry)) as SoundEffectRegistry;
        }

        return(soundEffectRegistry);
    }
コード例 #2
0
ファイル: SoundEffect.cs プロジェクト: proxemics/catagotchi
 public void PlaySound(PhysicMaterial materialObject, PhysicMaterial contactObject, float intensity)
 {
     PlaySound(SoundEffectRegistry.instance().GetSoundCombination(materialObject.name, contactObject.name), intensity);
 }