Exemplo n.º 1
0
        public override void OnCalculate()
        {
            FlexibleComponent item = _Weights.GetRandomItem();

            Component value = (item != null)?item.value : null;

            _Output.SetValue(value);
        }
Exemplo n.º 2
0
 void SerializeVer1()
 {
     _Text   = (FlexibleComponent)_OldText;
     _String = (FlexibleString)_OldString;
 }
Exemplo n.º 3
0
 void SerializeVer1()
 {
     _AudioSource = (FlexibleComponent)_OldAudioSource;
 }
Exemplo n.º 4
0
 void SerializeVer1()
 {
     _Button = (FlexibleComponent)_OldButton;
 }
Exemplo n.º 5
0
 void SerializeVer1()
 {
     _Target  = (FlexibleComponent)_OldTarget;
     _Message = (FlexibleString)_OldMessage;
 }
Exemplo n.º 6
0
 void SerializeVer1()
 {
     _Animator = (FlexibleComponent)_OldAnimator;
 }
Exemplo n.º 7
0
 void SerializeVer1()
 {
     _ExternalFSM = (FlexibleComponent)_OldExternalFSM;
 }
Exemplo n.º 8
0
 void SerializeVer1()
 {
     _AgentController = (FlexibleComponent)_OldAgentController;
 }
        public void UpdateInput(NodeGraph nodeGraph, GraphArgumentUpdateTiming updateTiming)
        {
            ParameterContainerInternal parameterContainer = nodeGraph.parameterContainer;

            if (parameterContainer == null)
            {
                return;
            }

            for (int i = 0, count = _Arguments.Count; i < count; ++i)
            {
                GraphArgument argument = _Arguments[i];

                if ((argument.updateTiming & updateTiming) == 0 ||
                    !argument.isPublicSet)
                {
                    continue;
                }

                Parameter parameter = argument.parameterID != 0? parameterContainer.GetParam(argument.parameterID) : parameterContainer.GetParam(argument.parameterName);

                string invalidText = GetInvalidText(argument, parameter);
                if (!string.IsNullOrEmpty(invalidText))
                {
                    Debug.LogWarning(invalidText, nodeGraph);
                    continue;
                }

                if (!parameter.isPublicSet)
                {
                    Debug.LogWarning("Set of parameter is not public. : \"" + parameter.name + "\"", nodeGraph);
                    continue;
                }

                switch (parameter.type)
                {
                case Parameter.Type.Int:
                {
                    FlexibleInt intParameter = _IntParameters[argument.parameterIndex];
                    parameter.intValue = intParameter.value;
                }
                break;

                case Parameter.Type.Long:
                {
                    FlexibleLong longParameter = _LongParameters[argument.parameterIndex];
                    parameter.longValue = longParameter.value;
                }
                break;

                case Parameter.Type.Float:
                {
                    FlexibleFloat floatParameter = _FloatParameters[argument.parameterIndex];
                    parameter.floatValue = floatParameter.value;
                }
                break;

                case Parameter.Type.Bool:
                {
                    FlexibleBool boolParameter = _BoolParameters[argument.parameterIndex];
                    parameter.boolValue = boolParameter.value;
                }
                break;

                case Parameter.Type.String:
                {
                    FlexibleString stringParameter = _StringParameters[argument.parameterIndex];
                    parameter.stringValue = stringParameter.value;
                }
                break;

                case Parameter.Type.Enum:
                {
                    FlexibleEnumAny enumParameter = _EnumParameters[argument.parameterIndex];
                    parameter.intValue = enumParameter.value;
                }
                break;

                case Parameter.Type.GameObject:
                {
                    FlexibleGameObject gameObjectParameter = _GameObjectParameters[argument.parameterIndex];
                    parameter.gameObjectValue = gameObjectParameter.value;
                }
                break;

                case Parameter.Type.Vector2:
                {
                    FlexibleVector2 vector2Parameter = _Vector2Parameters[argument.parameterIndex];
                    parameter.vector2Value = vector2Parameter.value;
                }
                break;

                case Parameter.Type.Vector3:
                {
                    FlexibleVector3 vector3Parameter = _Vector3Parameters[argument.parameterIndex];
                    parameter.vector3Value = vector3Parameter.value;
                }
                break;

                case Parameter.Type.Quaternion:
                {
                    FlexibleQuaternion quaternionParameter = _QuaternionParameters[argument.parameterIndex];
                    parameter.quaternionValue = quaternionParameter.value;
                }
                break;

                case Parameter.Type.Rect:
                {
                    FlexibleRect rectParameter = _RectParameters[argument.parameterIndex];
                    parameter.rectValue = rectParameter.value;
                }
                break;

                case Parameter.Type.Bounds:
                {
                    FlexibleBounds boundsParameter = _BoundsParameters[argument.parameterIndex];
                    parameter.boundsValue = boundsParameter.value;
                }
                break;

                case Parameter.Type.Color:
                {
                    FlexibleColor colorParameter = _ColorParameters[argument.parameterIndex];
                    parameter.colorValue = colorParameter.value;
                }
                break;

                case Parameter.Type.Transform:
                case Parameter.Type.RectTransform:
                case Parameter.Type.Rigidbody:
                case Parameter.Type.Rigidbody2D:
                case Parameter.Type.Component:
                {
                    FlexibleComponent componentParameter = _ComponentParameters[argument.parameterIndex];
                    parameter.objectReferenceValue = componentParameter.value;
                }
                break;

                case Parameter.Type.Variable:
                {
                    InputSlotTypable inputSlot = _InputSlots[argument.parameterIndex];
                    object           value     = null;
                    if (inputSlot.GetValue(ref value))
                    {
                        parameter.variableValue = value;
                    }
                }
                break;
                }
            }
        }
Exemplo n.º 10
0
 void SerializeVer1()
 {
     _Slider = (FlexibleComponent)_OldSlider;
     _Value  = (FlexibleFloat)_OldValue;
 }
Exemplo n.º 11
0
 void SerializeVer1()
 {
     _Target = (FlexibleComponent)_OldTarget;
 }
 void SerializeVer1()
 {
     _Slider = (FlexibleComponent)_OldSlider;
 }
Exemplo n.º 13
0
 void SerializeVer1()
 {
     _Toggle = (FlexibleComponent)_OldToggle;
     _Value  = (FlexibleBool)_OldValue;
 }
 void SerializeVer1()
 {
     _ExternalBT = (FlexibleComponent)_OldExternalBT;
 }
Exemplo n.º 15
0
 void SerializeVer1()
 {
     _Toggle = (FlexibleComponent)_OldToggle;
 }
Exemplo n.º 16
0
 void SerializeVer1()
 {
     _Image = (FlexibleComponent)_OldImage;
 }