Esempio n. 1
0
        protected override void Definition()
        {
            if (this is IDefaultValue <T> defaultValueUnit)
            {
                var mi = new List <ValueInput>();
                multiInputs = mi.AsReadOnly();

                for (var i = 0; i < inputCount; i++)
                {
                    if (i == 0)
                    {
                        mi.Add(ValueInput <T>(i.ToString()));
                        continue;
                    }

                    mi.Add(ValueInput(i.ToString(), defaultValueUnit.defaultValue));
                }
            }
            else
            {
                base.Definition();
            }

            sum = ValueOutput(nameof(sum), Operation).Predictable();

            foreach (var multiInput in multiInputs)
            {
                Requirement(multiInput, sum);
            }
        }
        protected override void Definition()
        {
            a = ValueInput <float>(nameof(a));
            b = ValueInput <float>(nameof(b), 0);

            aLessThanB             = ValueOutput(nameof(aLessThanB), Less).Predictable();
            aLessThanOrEqualToB    = ValueOutput(nameof(aLessThanOrEqualToB), LessOrEqual).Predictable();
            aEqualToB              = ValueOutput(nameof(aEqualToB), Equal).Predictable();
            aGreaterThanOrEqualToB = ValueOutput(nameof(aGreaterThanOrEqualToB), GreaterOrEqual).Predictable();
            aGreatherThanB         = ValueOutput(nameof(aGreatherThanB), Greater).Predictable();

            Requirement(a, aLessThanB);
            Requirement(b, aLessThanB);

            Requirement(a, aLessThanOrEqualToB);
            Requirement(b, aLessThanOrEqualToB);

            Requirement(a, aEqualToB);
            Requirement(b, aEqualToB);

            Requirement(a, aGreaterThanOrEqualToB);
            Requirement(b, aGreaterThanOrEqualToB);

            Requirement(a, aGreatherThanB);
            Requirement(b, aGreatherThanB);
        }
Esempio n. 3
0
        protected override void Definition()
        {
            selection = ValueOutput(nameof(selection), Result).Predictable();

            selector = ValueInput <T>(nameof(selector));

            Requirement(selector, selection);

            branches = new List <KeyValuePair <T, ValueInput> >();

            foreach (var option in options)
            {
                var key = "%" + option;

                if (!valueInputs.Contains(key))
                {
                    var branch = ValueInput <object>(key).AllowsNull();
                    branches.Add(new KeyValuePair <T, ValueInput>(option, branch));
                    Requirement(branch, selection);
                }
            }

            @default = ValueInput <object>(nameof(@default));

            Requirement(@default, selection);
        }
Esempio n. 4
0
        protected override void Definition()
        {
            collection = ValueInput <IEnumerable>(nameof(collection));
            count      = ValueOutput(nameof(count), Count);

            Requirement(collection, count);
        }
Esempio n. 5
0
        protected override void Definition()
        {
            enter = ControlInput(nameof(enter), Enter);
            reset = ControlInput(nameof(reset), Reset);

            duration     = ValueInput(nameof(duration), 1f);
            unscaledTime = ValueInput(nameof(unscaledTime), false);

            exitReady    = ControlOutput(nameof(exitReady));
            exitNotReady = ControlOutput(nameof(exitNotReady));
            tick         = ControlOutput(nameof(tick));
            becameReady  = ControlOutput(nameof(becameReady));

            remainingSeconds = ValueOutput <float>(nameof(remainingSeconds));
            remainingRatio   = ValueOutput <float>(nameof(remainingRatio));

            Requirement(duration, enter);
            Requirement(unscaledTime, enter);
            Succession(enter, exitReady);
            Succession(enter, exitNotReady);
            Succession(enter, tick);
            Succession(enter, becameReady);
            Assignment(enter, remainingSeconds);
            Assignment(enter, remainingRatio);
        }
Esempio n. 6
0
        protected override void Definition()
        {
            collection = ValueInput <IEnumerable>(nameof(collection));
            lastItem   = ValueOutput(nameof(lastItem), First);

            Requirement(collection, lastItem);
        }
        protected override void Definition()
        {
            base.Definition();

            index = ValueOutput <int>(nameof(index));
            text  = ValueOutput <string>(nameof(text));
        }
Esempio n. 8
0
        protected ValueOutput ValueOutput(Type type, string key, Func <Flow, object> getValue)
        {
            EnsureUniqueOutput(key);
            var port = new ValueOutput(key, type, getValue);

            valueOutputs.Add(port);
            return(port);
        }
Esempio n. 9
0
        protected ValueOutput ValueOutput(Type type, string key)
        {
            EnsureUniqueOutput(key);
            var port = new ValueOutput(key, type);

            valueOutputs.Add(port);
            return(port);
        }
Esempio n. 10
0
        protected override void Definition()
        {
            enter  = ControlInput(nameof(enter), Enter);
            exit   = ControlOutput(nameof(exit));
            output = ValueOutput(type, nameof(output), Create);

            Succession(enter, exit);
        }
Esempio n. 11
0
        protected override void Definition()
        {
            base.Definition();

            other = ValueOutput <GameObject>(nameof(other));

            collisionEvents = ValueOutput <List <ParticleCollisionEvent> >(nameof(collisionEvents));
        }
        protected override void Definition()
        {
            list     = ValueInput <IList>(nameof(list));
            item     = ValueInput <object>(nameof(item));
            contains = ValueOutput(nameof(contains), Contains);

            Requirement(list, contains);
            Requirement(item, contains);
        }
Esempio n. 13
0
        protected override void Definition()
        {
            input    = ValueInput <object>(nameof(input)).AllowsNull();
            fallback = ValueInput <object>(nameof(fallback));
            result   = ValueOutput(nameof(result), Coalesce).Predictable();

            Requirement(input, result);
            Requirement(fallback, result);
        }
        protected override void Definition()
        {
            dictionary = ValueInput <IDictionary>(nameof(dictionary));
            key        = ValueInput <object>(nameof(key));
            value      = ValueOutput(nameof(value), Get);

            Requirement(dictionary, value);
            Requirement(key, value);
        }
        protected override void Definition()
        {
            @base    = ValueInput <float>(nameof(@base), 1);
            exponent = ValueInput <float>(nameof(exponent), 2);
            power    = ValueOutput(nameof(power), Exponentiate);

            Requirement(@base, power);
            Requirement(exponent, power);
        }
        protected override void Definition()
        {
            dictionary = ValueInput <IDictionary>(nameof(dictionary));
            key        = ValueInput <object>(nameof(key));
            contains   = ValueOutput(nameof(contains), Contains);

            Requirement(dictionary, contains);
            Requirement(key, contains);
        }
        protected override void Definition()
        {
            a        = ValueInput <float>(nameof(a));
            b        = ValueInput <float>(nameof(b), 0);
            notEqual = ValueOutput(nameof(notEqual), Comparison).Predictable();

            Requirement(a, notEqual);
            Requirement(b, notEqual);
        }
Esempio n. 18
0
 protected override void Definition()
 {
     base.Definition();
     collider         = ValueOutput <Collider2D>(nameof(collider));
     contacts         = ValueOutput <ContactPoint2D[]>(nameof(contacts));
     relativeVelocity = ValueOutput <Vector2>(nameof(relativeVelocity));
     enabled          = ValueOutput <bool>(nameof(enabled));
     data             = ValueOutput <Collision2D>(nameof(data));
 }
Esempio n. 19
0
        protected override void Definition()
        {
            list  = ValueInput <IList>(nameof(list));
            index = ValueInput(nameof(index), 0);
            item  = ValueOutput(nameof(item), Get);

            Requirement(list, item);
            Requirement(index, item);
        }
Esempio n. 20
0
        protected override void Definition()
        {
            radicand = ValueInput <float>(nameof(radicand), 1);
            degree   = ValueInput <float>(nameof(degree), 2);
            root     = ValueOutput(nameof(root), Root);

            Requirement(radicand, root);
            Requirement(degree, root);
        }
        protected override void Definition()
        {
            base.Definition();

            stringParameter          = ValueOutput <string>(nameof(stringParameter));
            floatParameter           = ValueOutput <float>(nameof(floatParameter));
            intParameter             = ValueOutput <int>(nameof(intParameter));
            objectReferenceParameter = ValueOutput <UnityObject>(nameof(objectReferenceParameter));
        }
        protected override void Definition()
        {
            base.Definition();

            collider         = ValueOutput <Collider>(nameof(collider));
            contacts         = ValueOutput <ContactPoint[]>(nameof(contacts));
            impulse          = ValueOutput <Vector3>(nameof(impulse));
            relativeVelocity = ValueOutput <Vector3>(nameof(relativeVelocity));
            data             = ValueOutput <Collision>(nameof(data));
        }
Esempio n. 23
0
        protected override void Definition()
        {
            base.Definition();

            name = ValueInput(nameof(name), string.Empty);

            floatParameter           = ValueOutput <float>(nameof(floatParameter));
            intParameter             = ValueOutput <int>(nameof(intParameter));
            objectReferenceParameter = ValueOutput <GameObject>(nameof(objectReferenceParameter));
        }
        protected void Connect(ValueOutput source, ValueInput destination)
        {
            Undo.IncrementCurrentGroup();
            LudiqEditorUtility.editedObject.BeginOverride(m_Reference.serializedObject);
            var widget            = new ValueOutputWidget(m_Canvas, source);
            var connectMethodInfo = GetConnectionMethodInfo(widget.GetType());

            connectMethodInfo?.Invoke(widget, new object[] { widget.port, destination });
            LudiqEditorUtility.editedObject.EndOverride();
        }
Esempio n. 25
0
        protected override void Definition()
        {
            base.Definition();

            breakForce     = ValueOutput <float>(nameof(breakForce));
            breakTorque    = ValueOutput <float>(nameof(breakTorque));
            connectedBody  = ValueOutput <Rigidbody2D>(nameof(connectedBody));
            reactionForce  = ValueOutput <Vector2>(nameof(reactionForce));
            reactionTorque = ValueOutput <float>(nameof(reactionTorque));
            joint          = ValueOutput <Joint2D>(nameof(joint));
        }
Esempio n. 26
0
        protected override void Definition()
        {
            list = ValueOutput(nameof(list), Merge);

            base.Definition();

            foreach (var input in multiInputs)
            {
                Requirement(input, list);
            }
        }
        protected override void Definition()
        {
            dictionary = ValueOutput(nameof(dictionary), Merge);

            base.Definition();

            foreach (var input in multiInputs)
            {
                Requirement(input, dictionary);
            }
        }
Esempio n. 28
0
        private int Start(Flow flow, out int currentIndex, out int lastIndex, out bool ascending)
        {
            var firstIndex = flow.GetValue <int>(this.firstIndex);

            lastIndex    = flow.GetValue <int>(this.lastIndex);
            ascending    = firstIndex <= lastIndex;
            currentIndex = firstIndex;
            flow.SetValue(this.currentIndex, currentIndex);

            return(flow.EnterLoop());
        }
Esempio n. 29
0
        protected override void Definition()
        {
            base.Definition();

            minimum = ValueOutput(nameof(minimum), Operation).Predictable();

            foreach (var multiInput in multiInputs)
            {
                Requirement(multiInput, minimum);
            }
        }
        protected override void Definition()
        {
            base.Definition();

            collider      = ValueOutput <Collider>(nameof(collider));
            controller    = ValueOutput <CharacterController>(nameof(controller));
            moveDirection = ValueOutput <Vector3>(nameof(moveDirection));
            moveLength    = ValueOutput <float>(nameof(moveLength));
            normal        = ValueOutput <Vector3>(nameof(normal));
            point         = ValueOutput <Vector3>(nameof(point));
            data          = ValueOutput <ControllerColliderHit>(nameof(data));
        }