This topic is not available in your language. Therefore, the original version (ja-jp) is displayed.
Public APIs
AstroNotes - Live Machine では、開発者向けに各種 API を提供しています。
各種 API は NatsunekoLaboratory.AstroNotes.LiveMachine クラスの Public メソッドとして提供されています。
StartLiveMachine
StartLiveMachine メソッドは、Live Machine でのタイムラインの再生を開始するためのメソッドです。
using UdonSharp;
using UnityEngine;
class ExampleBehaviour : UdonSharpBehaviour {
[SerializeField]
private LiveMachine _player;
private void Start()
{
_player.StartLiveMachine();
}
}PauseLiveMachine
PauseLiveMachine メソッドは、Live Machine でのタイムラインの再生を一時停止するためのメソッドです。再生が開始されていない場合 (どこからもまだ StartLiveMachine が呼び出されていない場合) は、何も起こりません。
using UdonSharp;
using UnityEngine;
class ExampleBehaviour : UdonSharpBehaviour {
[SerializeField]
private LiveMachine _player;
private void Start()
{
_player.PauseLiveMachine();
}
}ResumeLiveMachine
ResumeLiveMachine メソッドは、Live Machine でのタイムラインの再生を再開するためのメソッドです。再生が一時停止されている場合にのみ効果があります。
using UdonSharp;
using UnityEngine;
class ExampleBehaviour : UdonSharpBehaviour {
[SerializeField]
private LiveMachine _player;
private void Start()
{
_player.ResumeLiveMachine();
}
}SetEventListener
SetEventListener メソッドは、Live Machine のイベントリスナーを設定するためのメソッドです。
各種イベントハンドラー を実装した UdonSharpBehaviour を指定します。
通常は、 NatsunekoLaboratory.AstroNotes.LiveMachineProxyBase クラスを継承したクラスにて、自身を指定します。
using UdonSharp;
using UnityEngine;
using NatsunekoLaboratory.AstroNotes;
class ExampleBehaviour : LiveMachineProxyBase
{
[SerializeField]
private LiveMachine _player;
private void Start()
{
_player.SetEventListener(this);
}
}