/* * Button * Pressable clip button */ public static ClipButtonAttachment CreateClipButton(InstrumentClip clip, UIFrame.AnchorLocation anchor) { GameObject button = Instantiate(Instance.clipButtonPrefab) as GameObject; ClipButtonAttachment attach = button.GetComponent <ClipButtonAttachment>(); attach.Init(clip); UIFrame frame = button.GetComponent <UIFrame>(); frame.SetAnchor(anchor); return(attach); }
/* * 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); }