Ejemplo n.º 1
0
        public UITextInput CreateTextInput(string paramName, string label, string startingValue, float height, bool rightSide = false)
        {
            var o = _builder.CreateTextInput(paramName, label, startingValue, height, rightSide);

            _objects.Add(o);
            return(o);
        }
Ejemplo n.º 2
0
        public void CreateUI(IUIBuilder builder)
        {
            AddressInput = builder.CreateTextInput("OutputTarget:Udp:Address", "Address:", "127.0.0.1", 50);
            PortInput    = builder.CreateTextInput("OutputTarget:Udp:Port", "Port:", "8889", 50);
            IpText       = AddressInput.storable;
            PortText     = PortInput.storable;

            ButtonGroup = builder.CreateHorizontalGroup(510, 50, new Vector2(10, 0), 2, idx => builder.CreateButtonEx());
            var startSerialButton = ButtonGroup.items[0].GetComponent <UIDynamicButton>();

            startSerialButton.label = "Start Udp";
            startSerialButton.button.onClick.AddListener(StartUdp);

            var stopSerialButton = ButtonGroup.items[1].GetComponent <UIDynamicButton>();

            stopSerialButton.label = "Stop Udp";
            stopSerialButton.button.onClick.AddListener(StopUdp);

            StartUdpAction = UIManager.CreateAction("Start Udp", StartUdp);
            StopUdpAction  = UIManager.CreateAction("Stop Udp", StopUdp);
        }