Ejemplo n.º 1
0
        private static void InitUIElement <T, K>(CreateCallback createAction,
                                                 OSCWindowControlCreator.ControlData data,
                                                 MenuCommand menuCommand) where K : OSCTransmitterInformer where T : Component
        {
            if (createAction == null)
            {
                return;
            }

            var resources = OSCEditorUtils.GetStandardResources();

            resources.Color = data.ControlColor;

            var element = createAction(resources);

            PlaceUIElement(element, menuCommand);

            if (data.UseInformer)
            {
                AddInformer <K>(element.GetComponent <T>(),
                                data.InformerTransmitter,
                                data.InformAddress,
                                data.InformOnChanged,
                                data.InformInterval);
            }
        }
Ejemplo n.º 2
0
        private static void InitMultiplySlidersUIElement(CreateCallback createAction, OSCWindowControlCreator.ControlData data, MenuCommand menuCommand)
        {
            if (createAction == null)
            {
                return;
            }

            var resources = OSCEditorUtils.GetStandardResources();

            resources.Color = data.ControlColor;

            var element = createAction(resources);

            if (data.UseInformer)
            {
                var multiplySliders = element.GetComponent <OSCMultiplySliders>();
                multiplySliders.Address     = data.InformAddress;
                multiplySliders.Transmitter = data.InformerTransmitter;
            }

            PlaceUIElement(element, menuCommand);
        }