using System;
using EvolutStudio.tinysAPI.BaseClasses;

namespace EvolutStudio
{
    namespace VRPortfolioWork
    {
        namespace Components
        {
            public class SimpleAudioSourcePlayComponent : BaseClassComponent
            {
                #region Public Attributes

                // Add your public attributes

                #endregion

                #region Private Attributes

                // private reference to the game object audio source instance
                private GvrAudioSource _audioSource;

                #endregion

                #region Public Functions

                public override void ValidationFailed(string notification)
                {
                    throw new NotImplementedException();
                }

                public override void ValidationSucceeded(string notification)
                {
                    if (notification.Equals(BaseClassNotification.POINTERCLICKEVENT))
                    {
                        // play audio source
                        _audioSource.Play();
                    }
                }

                // Use this for initialization
                public override void Init()
                {
                    _ComponentsArrayIndex = modulInstance.View.RegisterComponent(this);

                    // save the reference
                    _audioSource = GetComponent<GvrAudioSource>();
                }

                #endregion

                #region Private Functions

                // Add your private functions

                #endregion
            }
        }
    }
}
