Exemplo n.º 1
0
    public override void Update()
    {
        base.Update();

        if (outputElement == null || input1 == null)
        {
            return;
        }

        if (gateType != GateType.Not && input2 == null)
        {
            return;
        }

        switch (gateType)
        {
        case GateType.And:
            output = input1.GetValue() && input2.GetValue();
            break;

        case GateType.Or:
            output = input1.GetValue() || input2.GetValue();
            break;

        case GateType.Not:
            output = !input1.GetValue();
            break;
        }
    }
Exemplo n.º 2
0
    // Update is called once per frame
    public override void Update()
    {
        base.Update();

        if (inputNode != null)
        {
            renderer.color = (inputNode.GetValue()) ? App.Instance.on : App.Instance.off;
        }

        if (icon != null)
        {
            icon.color = (inputNode.GetValue()) ? Color.white : new Color(1, 1, 1, 0.5f);
        }
    }
Exemplo n.º 3
0
 public bool GetValue()
 {
     if (input != null)
     {
         return(input.GetValue());
     }
     else
     {
         input = GetComponentInChildren <InputNode>();
         return(input.GetValue());
     }
 }
Exemplo n.º 4
0
        public override string GetValue()
        {
            string suffix = "";

            //int min = InputMin.GetValue() ?? 0;
            //int? max = InputMax.GetValue();

            switch (InputCount.DropdownValue)
            {
            case "Zero or more": suffix = "*"; break;

            case "One or more": suffix = "+"; break;

            case "Zero or one": suffix = "?"; break;

            case "Number": suffix = $"{{{InputNumber.InputContents}}}"; break;

            case "Range":
                int min = InputMin.GetValue() ?? 0;
                int?max = InputMax.GetValue();
                suffix = $"{{{min},{max}}}";
                break;
            }

            if (InputSearchType.DropdownValue == "Lazy")
            {
                suffix += "?";
            }

            string contents = InputNode.GetValue();

            if (!contents.IsSingleRegexChar())
            {
                contents = contents.EnforceGrouped();
            }

            string result = contents + suffix;

            return(UpdateCache(result));
        }