public override void OnTrigger(OSCUnit unit) { if (unit.buttons[1]) { Clear(); } }
public override void OnTrigger(OSCUnit unit) { if (unit.buttons[1]) { seed += new Vector4(Random.value, Random.value, Random.value, Random.value); } }
public override void OnTrigger(OSCUnit unit) { if (unit.buttons[1]) { Explode(); } }
public void OnControl(OSCUnit unit) { if (unit.index >= system.updaters.Count) { return; } var updater = system.updaters[unit.index]; updater.OnControl(unit); }
public override void OnTrigger(OSCUnit unit) { if (unit.buttons[1]) { mode = FormationMode.Ring; } else if (unit.buttons[2]) { mode = FormationMode.Circle; } else if (unit.buttons[3]) { mode = FormationMode.Wave; } }
public override void OnTrigger(OSCUnit unit) { if (unit.buttons[1]) { mode = ExtrusionMode.Spread; } else if (unit.buttons[2]) { mode = ExtrusionMode.Axis; } else if (unit.buttons[3]) { mode = ExtrusionMode.Physics; } }
public void OnTrigger(OSCUnit unit) { if (unit.index >= system.updaters.Count) { return; } var updater = system.updaters[unit.index]; if (unit.buttons[0] != updater.gameObject.activeSelf) { updater.gameObject.SetActive(unit.buttons[0]); } if (unit.buttons[0]) { updater.OnTrigger(unit); } }
public override void OnControl(OSCUnit unit) { scale = Mathf.Lerp(scaleRange.x, scaleRange.y, unit.sliders[0]); intensity = Mathf.Lerp(intensityRange.x, intensityRange.y, unit.sliders[1]); speed = Mathf.Lerp(speedRange.x, speedRange.y, unit.sliders[2]); }
public override void OnControl(OSCUnit unit) { speed = Mathf.Lerp(speedRange.x, speedRange.y, unit.sliders[0]); size = Mathf.Lerp(sizeRange.x, sizeRange.y, unit.sliders[1]); }
public override void OnControl(OSCUnit unit) { speed = Mathf.Lerp(speedRange.x, speedRange.y, unit.sliders[0]); scale = Mathf.Lerp(scaleRange.x, scaleRange.y, unit.sliders[1]); ratio = Mathf.Lerp(0f, _RatioMax, unit.sliders[2]); }
public override void OnControl(OSCUnit unit) { radius = Mathf.Lerp(radiusRange.x, radiusRange.y, unit.sliders[0]); size = Mathf.Lerp(sizeRange.x, sizeRange.y, unit.sliders[1]); intensity = Mathf.Lerp(intensityRange.x, intensityRange.y, unit.sliders[2]); }
void Receive(OSCMessage msg) { var address = msg.Address.Split('/'); if (address[1] == "core") { if (address[2] == "color") { float r = float.Parse(msg.Data[0].ToString()); float g = float.Parse(msg.Data[1].ToString()); float b = float.Parse(msg.Data[2].ToString()); onCoreColor.Invoke(new Color(r, g, b)); } else if (address[2] == "distance") { float distance = float.Parse(msg.Data[0].ToString()); onCoreDistance.Invoke(distance); } } else if (address[1] == "mattatz") { if (address[2] == "begin") { onBegin.Invoke(); return; } else if (address[2] == "replay") { for (int i = 0, n = onReplay.GetPersistentEventCount(); i < n; i++) { var behaviour = onReplay.GetPersistentTarget(i) as MonoBehaviour; behaviour.gameObject.SetActive(true); } onReplay.Invoke(); return; } else if (address[2] == "start") { onStart.Invoke(); return; } int index = int.Parse(msg.Data[0].ToString()); if (!units.ContainsKey(index)) { units[index] = new OSCUnit(index, _ButtonCount, _SliderCount); } var unit = units[index]; if (address[2] == "trigger") { for (int i = 0; i < _ButtonCount; i++) { unit.buttons[i] = int.Parse(msg.Data[i + 1].ToString()) == 1; } onTrigger.Invoke(unit); } else if (address[2] == "control") { for (int i = 0; i < _SliderCount; i++) { unit.sliders[i] = float.Parse(msg.Data[i + 1].ToString()); } onControl.Invoke(unit); } } }
public virtual void OnControl(OSCUnit unit) { }
public virtual void OnTrigger(OSCUnit unit) { }