コード例 #1
0
    private void ReadBook(object sender, RPGEvents.ReadBookEventArgs e)
    {
        var book = e.Book;

        CurrentAudio = e.NullableAudio;
        UpdateState(book);
    }
コード例 #2
0
        public void ReadBook(Book book)
        {
            if (book == null)
            {
                return;
            }

            if (CurrentBook != null)
            {
                CloseBook();
            }

            AudioBase audioObj = null;

            if (book.BookType == BookType.Audio)
            {
                var go = AudioPlayer.Instance.Play(book.Audio, AudioType.Voice, Vector3.zero, null, AudioBookId);
                if (go != null)
                {
                    audioObj = go.GetComponent <AudioBase>();
                }
            }

            CurrentBook = book;
            if (CurrentBook != null)
            {
                CurrentBook.CurrentPage = 0;
            }
            var args = new RPGEvents.ReadBookEventArgs {
                Book = book, NullableAudio = audioObj
            };

            RPG.Events.OnReadBook(args);
        }
コード例 #3
0
 private void ClosedBook(object sender, RPGEvents.ClosedBookEventArgs e)
 {
     AudioPanel.SetActive(BookHandler.Reading && BookHandler.CurrentBook.BookType == BookType.Audio);
     PictureBookPanel.SetActive(BookHandler.Reading && BookHandler.CurrentBook.BookType == BookType.Picture);
     TextBookPanel.SetActive(BookHandler.Reading && BookHandler.CurrentBook.BookType == BookType.Text);
     CurrentAudio = null;
 }
コード例 #4
0
ファイル: AudioManager.cs プロジェクト: Costava/Dishes-Please
    public float GetMasterVolume(AudioBase.AudioType type)
    {
        float volume = 1f;
        this.masterVolume.TryGetValue(type, out volume);

        return volume;
    }
コード例 #5
0
 public DeviceBase(AudioBase audio, VideoBase video)
 {
     _audio      = audio;
     _video      = video;
     _deviceType = DeviceType.NO_DEVICE;
     _name       = "Plug in your Kinect";
 }
コード例 #6
0
 public DeviceBase(AudioBase audio, VideoBase video, KinectSensor sensor_xbox360)
 {
     _audio      = audio;
     _video      = video;
     sensor      = sensor_xbox360;
     _deviceType = DeviceType.KINECT_1;
     _name       = "K360-" + sensor.UniqueKinectId;
 }
コード例 #7
0
 public DeviceBase(AudioBase audio, VideoBase video, String filePath)
 {
     _audio                 = audio;
     _video                 = video;
     _filePath              = filePath;
     _deviceType            = DeviceType.RECORD_FILE_KINECT_1;
     _name                  = "RF-" + System.IO.Path.GetFileName(_filePath);
     replay                 = new KinectReplay(_filePath);
     replay.ReplayFinished += Replay_ReplayFinished;
 }
コード例 #8
0
ファイル: AudioManager.cs プロジェクト: Costava/Dishes-Please
    public void SetMasterVolume(AudioBase.AudioType type, float volume)
    {
        this.masterVolume[type] = Mathf.Clamp(volume, 0, 1);
        //Debug.Log("Changing Master Volume: " + type + " - " + this.masterVolume[type]);

        // Save it persistently
        PlayerPrefs.SetFloat("MasterVolume_" + type, this.masterVolume[type]);

        // Fire the event
        this.ThisVolumeChanged(this, new VolumeChangeEventArgs(type, volume));
    }
コード例 #9
0
    public AudioBase GetSoundObjectByID(string soundId)
    {
        AudioBase foundSound   = null;
        var       audioObjects = GameObject.FindGameObjectsWithTag("RPGAudioObject");

        for (int i = 0; i < audioObjects.Length; i++)
        {
            var child = audioObjects[i];
            var comp  = child.GetComponent <AudioBase>();
            if (comp != null && comp.SoundID == soundId)
            {
                foundSound = comp;
                break;
            }
        }

        return(foundSound);
    }
コード例 #10
0
 public Device(AudioBase audio, VideoBase video) : base(audio, video)
 {
 }
コード例 #11
0
 public Device(AudioBase audio, VideoBase video, String filePath) : base(audio, video, filePath)
 {
 }
コード例 #12
0
 public Device(AudioBase audio, VideoBase video, KinectSensor sensor_xbox360) : base(audio, video, sensor_xbox360)
 {
 }
コード例 #13
0
ファイル: AudioManager.cs プロジェクト: Costava/Dishes-Please
 public VolumeChangeEventArgs(AudioBase.AudioType audioType, float volume)
 {
     this.audioType = audioType;
     this.volume = volume;
 }
コード例 #14
0
 public ComandosDinamicosDeAudio(AudioBase audio, GerenciadorDeFilas gerenciadorDeFilas)
 {
     Audio = audio;
     GerenciadorDeFilas = gerenciadorDeFilas;
     GerenciadorDeFilas.ExecutorDeAudio.AoFinalizarExecucao = FinalizarExecucao;
 }