コード例 #1
0
    public void Setup(object value, int ID, WorldSpaceUI UI, InputCanvas.InputElements elements, bool isVariable = false, string variableName = "constant")
    {
        this.value        = value;
        this.UI           = UI;
        this.elements     = elements;
        this.isVariable   = isVariable;
        this.VariableName = variableName;
        this.ID           = ID;

        ///Reusing the Constant code for variables too, will fix semantics later
        if (this.isVariable)
        {
            this.originalColor = Color.Lerp(Color.red, Color.yellow, 0.5f).SetAlpha();
            this.elements.Button.GetComponent <Image>().color = this.originalColor;
        }
        else
        {
            this.originalColor = this.elements.Button.GetComponent <Image>().color;
        }

        gameObject.GetComponent <Button>().onClick.AddListener(this.OnClick);
    }
コード例 #2
0
    public void RegisterDirectInputClick(DirectInputNode node, ParameterNode paraNodeIn = null)
    {
        var paraNode = this.lastClickedParameter;

        if (paraNodeIn != null)
        {
            paraNode = paraNodeIn;
        }

        if (paraNode != null)
        {
            if (node.elements.Used)
            {
                Debug.Log("constant already used");
                return;
            }

            this.connTracker.TrackParameterAssignConstant(paraNode, node);

            this.inputCanvas.InputsHide();

            paraNode.RegisterAssignment();

            InputCanvas.InputElements n = this.inputCanvas.GetInputs().Single(x => x.Node == node);

            n.Used = true;
            n.Node.SetUsed(true, paraNode);

            return;
        }

        if (this.lastClickedProperty != null)
        {
            // TODO:
        }
    }
コード例 #3
0
ファイル: DynamicSetup.cs プロジェクト: Nikismyname/RunTime
 public int AddVariable(string varName)
 {
     id++;
     InputCanvas.InputElements variable = this.inputCanvas.CreateInputCanvas(default, id, this.UI, true, varName);