Esempio n. 1
0
        public override void Reconstruct()
        {
            Debug.Log("reconstruct audio node");

            if (this.audioPlayer != null)
            {
                this.audioPlayer.Destroy();
            }

            if (streamed)
            {
                this.audioPlayer = new StreamedAudioPlayer(this.referenceID, this.audioPlayerName, this.cachePath, this.samplesLength);
            }
            else
            {
                this.audioPlayer = new BufferedAudioPlayer(this.referenceID, this.audioPlayerName, this.cachePath, this.samplesLength);
            }

            if (resourceResponse != null && this.audioPlayer != null)
            {
                if (arrayItem)
                {
                    FieldDeserializer field = resourceResponse.GetFieldDeserializer;
                    field.SetArrayItem(this.audioPlayer.GetAudioClip(), this.index);
                }
                else
                {
                    resourceResponse.GetFieldDeserializer.SetField(fieldName, this.audioPlayer.GetAudioClip());
                }
            }
        }