Beispiel #1
0
        public void SetVariable(NamedVariable variable)
        {
            if (variable == null)
            {
                ResetParameters();
                return;
            }
            switch (variable.VariableType)
            {
            case VariableType.Float:
                FloatParameter = variable as FsmFloat;
                break;

            case VariableType.Int:
                IntParameter = variable as FsmInt;
                break;

            case VariableType.Bool:
                BoolParameter = variable as FsmBool;
                break;

            case VariableType.GameObject:
                GameObjectParameter = variable as FsmGameObject;
                break;

            case VariableType.String:
                StringParameter = variable as FsmString;
                break;

            case VariableType.Vector2:
                Vector2Parameter = variable as FsmVector2;
                break;

            case VariableType.Vector3:
                Vector3Parameter = variable as FsmVector3;
                break;

            case VariableType.Color:
                ColorParameter = variable as FsmColor;
                break;

            case VariableType.Rect:
                RectParamater = variable as FsmRect;
                break;

            case VariableType.Material:
                MaterialParameter = variable as FsmMaterial;
                break;

            case VariableType.Texture:
                TextureParameter = variable as FsmTexture;
                break;

            case VariableType.Quaternion:
                QuaternionParameter = variable as FsmQuaternion;
                break;

            case VariableType.Object:
                ObjectParameter = variable as FsmObject;
                break;

            case VariableType.Array:
                ArrayParameter = variable as FsmArray;
                break;

            case VariableType.Enum:
                EnumParameter = variable as FsmEnum;
                break;

            default:
                throw new ArgumentOutOfRangeException();

            case VariableType.Unknown:
                break;
            }
        }