soundvision/UnityProject/Assets/Scripts/PdConnection/PdBackend.cs

34 lines
650 B
C#
Raw Normal View History

2019-09-28 18:17:39 +00:00
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;
}
}
}