Beispiel #1
0
        /*
         * Rotary Control
         * Creates a rotary param controller that uses twists to set values
         */
        public static RotaryAttachment CreateRotary(BaseInstrumentParam param)
        {
            GameObject       rotary = Instantiate(Instance.rotaryPrefab) as GameObject;
            RotaryAttachment attach = rotary.GetComponent <RotaryAttachment>();

            attach.Init(param);
            return(attach);
        }
Beispiel #2
0
    /*
     * Incoming methods
     */
    public object instrumentValueUpdated(ZstMethod methodData)
    {
        Debug.Log(methodData.output);
        Dictionary <string, object> output = JsonConvert.DeserializeObject <Dictionary <string, object> >(methodData.output.ToString());
        BaseInstrumentParam         param  = InstrumentController.Instance.FindParameter(Convert.ToInt32(output["trackindex"]), Convert.ToInt32(output["deviceindex"]), Convert.ToInt32(output["parameterindex"]));

        if (param != null)
        {
            param.setScaledVal(Convert.ToSingle(output["value"]), true);
        }
        return(null);
    }
Beispiel #3
0
        /*
         * Slider
         * A controllable parameter slider
         */
        public static SliderAttachment CreateSlider(BaseInstrumentParam param, UIFrame.AnchorLocation anchor)
        {
            GameObject slider = Instantiate(Instance.sliderPrefab) as GameObject;

            UIFrame frame = slider.GetComponent <UIFrame>();

            //frame.SetAnchor(UIFrame.AnchorLocation.TOP_LEFT);
            frame.SetAnchor(anchor);

            SliderAttachment attach = slider.GetComponent <SliderAttachment>();

            attach.Init(param);

            return(attach);
        }