soundvision/UnityProject/Assets/Scripts/PdConnection/PdBackend.cs
Chikashi Miyama 78023946cd close #28
2019-09-28 20:17:39 +02:00

34 lines
No EOL
650 B
C#

using System;
using UnityEngine;
namespace cylvester
{
public interface IPdBackend
{
bool State { set; }
}
[ExecuteInEditMode]
public class PdBackend : MonoBehaviour, IPdBackend
{
[SerializeField] string mainPatch;
[SerializeField] int inchannels = 2;
private Action onToggled_;
private void OnEnable()
{
PdProcess.Instance.Start(mainPatch, inchannels);
}
private void OnDisable()
{
PdProcess.Instance.Stop();
}
public bool State
{
set => enabled = value;
}
}
}