I'm having an issue though with my MIDI controller (Korg nanoKONTROL2) where within the Unity engine I can change values of a slider using a knob/encoder, but when I make a build it no longer works. This is the code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using MidiJack;
public class CityPower : MonoBehaviour {
public GameObject playerPowerBar;
public Image transferPower;
Slider cityPowerSlider;
// Use this for initialization
void Start () {
cityPowerSlider = GetComponent<Slider>();
}
// Update is called once per frame
void Update () {
var s = MidiMaster.GetKnob(16);
var d = MidiMaster.GetKnob(32);
cityPowerSlider.value = s;
if (s == 0.0)
{
cityPowerSlider.maxValue = 0.0f;
transferPower.GetComponent<Image>().enabled = true;
}
if (s == 0.0 & d == 1.0)
{
playerPowerBar.gameObject.GetComponent<PowerBar>().enabled = true;
Destroy(gameObject);
}
}
}
Anyone know why this would be happening? Please let me know if you need additional info.
Hey, thanks for sharing this!
I'm having an issue though with my MIDI controller (Korg nanoKONTROL2) where within the Unity engine I can change values of a slider using a knob/encoder, but when I make a build it no longer works. This is the code:
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using MidiJack;
public class CityPower : MonoBehaviour {
}
Anyone know why this would be happening? Please let me know if you need additional info.
Thanks.