public override void Setup()
        {
            Register(outputSocket);
            Register(inputSocket);

            SetHeader("operation");
            outputSocket.SetValue(0f);

            dropdown.AddOptions(new List <TMP_Dropdown.OptionData>()
            {
                new TMP_Dropdown.OptionData(MathOperations.Multiply.ToString()),
                new TMP_Dropdown.OptionData(MathOperations.Divide.ToString()),
                new TMP_Dropdown.OptionData(MathOperations.Add.ToString()),
                new TMP_Dropdown.OptionData(MathOperations.Subtract.ToString())
            });

            dropdown.onValueChanged.AddListener(selected =>
            {
                OnConnectedValueUpdated();
            });

            OnConnectionEvent += OnConnection;
            OnDisconnectEvent += OnDisconnect;
        }
Ejemplo n.º 2
0
        private void HandleInputValue(string value)
        {
            float floatValue = float.Parse(value);

            outputSocket.SetValue(floatValue);
        }