1
This repository has been archived on 2025-03-15. You can view files and clone it, but cannot push or open issues or pull requests.
unity-vr-portoflio/Assets/04 - Scripts/View/Components/SimpleAudioSourcePlayComponent.cs

61 lines
1.6 KiB
C#
Raw Permalink Normal View History

2025-03-15 20:02:21 +01:00
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
}
}
}
}