Esempio n. 1
0
    private void ReadBook(object sender, RPGEvents.ReadBookEventArgs e)
    {
        var book = e.Book;

        CurrentAudio = e.NullableAudio;
        UpdateState(book);
    }
Esempio n. 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);
        }
Esempio n. 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;
 }
Esempio n. 4
0
    public float GetMasterVolume(AudioBase.AudioType type)
    {
        float volume = 1f;
        this.masterVolume.TryGetValue(type, out volume);

        return volume;
    }
Esempio n. 5
0
 public DeviceBase(AudioBase audio, VideoBase video)
 {
     _audio      = audio;
     _video      = video;
     _deviceType = DeviceType.NO_DEVICE;
     _name       = "Plug in your Kinect";
 }
Esempio n. 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;
 }
Esempio n. 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;
 }
Esempio n. 8
0
    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));
    }
    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);
    }
Esempio n. 10
0
 public Device(AudioBase audio, VideoBase video) : base(audio, video)
 {
 }
Esempio n. 11
0
 public Device(AudioBase audio, VideoBase video, String filePath) : base(audio, video, filePath)
 {
 }
Esempio n. 12
0
 public Device(AudioBase audio, VideoBase video, KinectSensor sensor_xbox360) : base(audio, video, sensor_xbox360)
 {
 }
Esempio n. 13
0
 public VolumeChangeEventArgs(AudioBase.AudioType audioType, float volume)
 {
     this.audioType = audioType;
     this.volume = volume;
 }
Esempio n. 14
0
 public ComandosDinamicosDeAudio(AudioBase audio, GerenciadorDeFilas gerenciadorDeFilas)
 {
     Audio = audio;
     GerenciadorDeFilas = gerenciadorDeFilas;
     GerenciadorDeFilas.ExecutorDeAudio.AoFinalizarExecucao = FinalizarExecucao;
 }