예제 #1
0
    private void OnEnable()
    {
        oscTarget = (OSCInput)target;
        soTarget  = new SerializedObject(target);



        // OSC server Setup
        ipAddress  = soTarget.FindProperty("IPAddress");
        oscPortIn  = soTarget.FindProperty("oscPortIN");
        oscPortOut = soTarget.FindProperty("oscPortOut");


        // Test UI Builder with test OSC messages within Editor

        // Slider Tab
        numberOfSliders    = soTarget.FindProperty("slidersNum");
        isMushra           = soTarget.FindProperty("isMushra"); // slider type (mushra or 3G)
        oscTarget.isMushra = true;                              // set to mushra

        // Label Tab
        labelStrings    = soTarget.FindProperty("labelStrings");
        numberOfLabels  = soTarget.FindProperty("labelsNum");
        attributeLabels = soTarget.FindProperty("attributeLabels");
        screenMessages  = soTarget.FindProperty("screenMessages");

        // Button Tab
        referenceButtton = soTarget.FindProperty("referenceButtonPresent");
        ABbutton         = soTarget.FindProperty("ABbuttonsPresent");
    }
예제 #2
0
    // Start is called before the first frame update
    void Start()
    {
        _oscOut = GameObject.FindWithTag("OSCHandler").GetComponent <OSCOutput>();
        _oscIn  = GameObject.FindWithTag("OSCHandler").GetComponent <OSCInput>();


        _meshRenderer         = GetComponent <MeshRenderer>();
        _meshRenderer.enabled = true;

        _materials = _meshRenderer.materials;
        _mat0Color = _materials[0].color; //Not Connected
        _mat1Color = _materials[1].color; //Connected
        _materials[1].SetColor("_Color", Color.clear);

        _count = 0;
        _connectionFailCounter = 0;
    }
    private void SetupRange(bool isMushra)
    {
        buttonObject.SetActive(isMushra);
        sliderAttribute.enabled = !isMushra;
        if (isMushra)
        {
            slider.minValue = 0;
            slider.maxValue = 100;
            if (buttonObject.activeSelf)
            {
                buttonmsg = "cond" + _buttonText[sliderIndex];
            }

            oscInput     = OSCInput.Instance;
            slider.value = oscInput.sliderValues[sliderIndex];
        }
        else
        {
            slider.minValue = -3;
            slider.maxValue = 3;
            oscInput        = GameObject.Find("OSC.IN").GetComponent <OSCInput>();
            slider.value    = this.oscInput.sliderValues[sliderIndex];
        }
    }
예제 #4
0
 private void Awake()
 {
     _instance = this;
 }