Class EditorSampleSet
Contains the sample set functionality for the editor.
Inheritance
System.Object
EditorSampleSet
Syntax
[Serializable]
public abstract class EditorSampleSet
Properties
AudioClip
Returns an AudioClip containing the sample set data.
Declaration
public AudioClip AudioClip { get; }
Property Value
Type |
Description |
UnityEngine.AudioClip |
|
IsLooping
Returns whether the sample set is being played on a loop.
Declaration
public bool IsLooping { get; }
Property Value
Type |
Description |
System.Boolean |
|
IsPlaying
Returns whether the sample set is being played.
Declaration
public bool IsPlaying { get; }
Property Value
Type |
Description |
System.Boolean |
|
Length
Declaration
public int Length { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
PlaybackPosition
Returns the playback position in seconds.
Declaration
public float PlaybackPosition { get; set; }
Property Value
Type |
Description |
System.Single |
|
SampleSet
Declaration
protected virtual SampleSet SampleSet { get; set; }
Property Value
TotalSeconds
Declaration
public float TotalSeconds { get; }
Property Value
Type |
Description |
System.Single |
|
Volume
Declaration
public float Volume { get; set; }
Property Value
Type |
Description |
System.Single |
|
Methods
AddAndSubtractSamples(Single[], Single[], Int32)
Declaration
public void AddAndSubtractSamples(float[] addSamples, float[] subtractSamples, int startIndex = 0)
Parameters
Type |
Name |
Description |
System.Single[] |
addSamples |
|
System.Single[] |
subtractSamples |
|
System.Int32 |
startIndex |
|
AddSamples(Single[], Int32)
Declaration
public void AddSamples(float[] newSamples, int startIndex = 0)
Parameters
Type |
Name |
Description |
System.Single[] |
newSamples |
|
System.Int32 |
startIndex |
|
GenerateAudioClip()
Declaration
public void GenerateAudioClip()
GetSamples()
Declaration
public float[] GetSamples()
Returns
Type |
Description |
System.Single[] |
|
OnCreate()
Performs actions required on creation of an EditorSampleSet.
Declaration
protected virtual void OnCreate()
OnEnable()
Performs actions required when the EditorSampleSet is enabled.
Declaration
public virtual void OnEnable()
Play(Boolean)
Declaration
public void Play(bool loop = false)
Parameters
Type |
Name |
Description |
System.Boolean |
loop |
Should the sample set be played on a loop?
|
SetSamples(Single[], Int32)
Declaration
public void SetSamples(float[] newSamples, int startIndex = 0)
Parameters
Type |
Name |
Description |
System.Single[] |
newSamples |
|
System.Int32 |
startIndex |
|
Stop()
Stop playing the sample set.
Declaration
SubtractSamples(Single[], Int32)
Declaration
public void SubtractSamples(float[] newSamples, int startIndex = 0)
Parameters
Type |
Name |
Description |
System.Single[] |
newSamples |
|
System.Int32 |
startIndex |
|
Events
Changed
Declaration
public event Action<float[], float[], int> Changed
Event Type
Type |
Description |
System.Action<System.Single[], System.Single[], System.Int32> |
|