Ejemplo n.º 1
0
    public AudioClip GetOneShotClip(SoundOneShot soundFile)
    {
        switch (soundFile)
        {
        //"Environment
        case SoundOneShot.TrainOpenDoor: return(trainOpenDoor);

        case SoundOneShot.TrainCloseDoor: return(trainCloseDoor);

        //"Spider
        case SoundOneShot.SpiderBite: return(spiderBite);

        case SoundOneShot.SpiderGrab: return(spiderGrab);

        case SoundOneShot.SpiderUngrab: return(spiderUngrab);

        case SoundOneShot.SpiderHit: return(spiderHit);

        //UI
        case SoundOneShot.ButtonClick: return(buttonClick);

        case SoundOneShot.SpiderSwitchEmotion: return(spiderSwitchEmotion);
        }

        return(null);
    }
Ejemplo n.º 2
0
    public void PlayOneShot(SoundOneShot sound, float volumeFactor = 1)
    {
        if (!hasOneShotTrack)
        {
            Debug.LogWarning("This AudioBox do not have a OneShotTrack, " + sound + " cannot be played");
            return;
        }

        AudioManager.Instance.PlayOneShot(sound, oneShotSource);
    }
Ejemplo n.º 3
0
    public SoundOneShotClip SoundOneShotToClip(SoundOneShot sound)
    {
        switch (sound)
        {
        case SoundOneShot.CreatureAttack: return(creatureAttack);

        case SoundOneShot.CreatureSpawn: return(creatureSpawn);

        case SoundOneShot.CreatureEatCreature: return(creatureEatCreature);

        case SoundOneShot.CreatureEatFood: return(creatureEatFood);

        case SoundOneShot.CreatureAlert: return(creatureAlert);

        case SoundOneShot.CreatureFear: return(creatureFear);

        case SoundOneShot.CreatureSpotPrey: return(creatureSpotPrey);

        case SoundOneShot.CreatureDamagedWithoutResistance: return(creatureDamagedWithoutResistance);

        case SoundOneShot.CreatureDamagedWithResistance: return(creatureDamagedWithResistance);

        case SoundOneShot.CreatureHappy: return(creatureHappy);

        case SoundOneShot.CreatureHungry: return(creatureHungry);

        case SoundOneShot.CreatureSuspicious: return(creatureSuspicious);

        case SoundOneShot.CreatureCurious: return(creatureCurious);

        case SoundOneShot.CreatureLove: return(creatureLove);

        case SoundOneShot.CreatureTired: return(creatureTired);

        case SoundOneShot.CreatureDefense: return(creatureDefense);

        case SoundOneShot.EcodexOpen: return(ecoDexOpen);

        case SoundOneShot.EcodexClose: return(ecoDexClose);

        case SoundOneShot.EcodexPage: return(ecoDexPage);

        case SoundOneShot.PhotomodeActive: return(photoModeActive);

        case SoundOneShot.PhotomodeDeactive: return(photoModeDeactive);

        case SoundOneShot.TakePhoto: return(takePhoto);

        case SoundOneShot.FlashUI: return(changeFlash);

        case SoundOneShot.FlashUI_DOWN: return(changeFlashDOWN);

        case SoundOneShot.FlashUI_UP: return(changeFlashUP);

        case SoundOneShot.FlashSoundEffect: return(flashSoundEffect);

        case SoundOneShot.ChangePhotoSound: return(changePhotoSound);

        case SoundOneShot.DeletePhotoSound: return(deletePhotoSound);

        default:
            Debug.LogError("SoundOneShotClip : " + sound + " was not found!");
            return(null);

        case SoundOneShot.PlayerWalk: return(playerWalk);

        case SoundOneShot.PlayerRun: return(playerRun);

        case SoundOneShot.Flashlight: return(flashlight);

        case SoundOneShot.DiscoverCreature: return(discoverCreature);
        }
    }
Ejemplo n.º 4
0
 public void PlaySoundOneShot(SoundOneShot sound, float volume = 1f)
 {
     soundSource.PlayOneShot(audioFiles.GetOneShotClip(sound), volume * soundGlobalVolume);
 }
Ejemplo n.º 5
0
    public void PlayOneShot(SoundOneShot sound, AudioSource source, float volumeFactor = 1)
    {
        SoundOneShotClip c = audioFiles.SoundOneShotToClip(sound);

        source.PlayOneShot(c.Clip, c.Volume * volumeFactor * globalVolume);
    }