Exemplo n.º 1
0
        sealed public override VFXValue DefaultExpression(VFXValue.Mode mode)
        {
            if (value == null)
            {
                return(null);
            }

            var floatN = (FloatN)value;

            return(floatN.ToVFXValue(mode));
        }
Exemplo n.º 2
0
        public VFXValue ToVFXValue(VFXValue.Mode mode)
        {
            switch (realSize)
            {
            case 1: return(new VFXValue <float>(this, mode));

            case 2: return(new VFXValue <Vector2>(this, mode));

            case 3: return(new VFXValue <Vector3>(this, mode));

            case 4: return(new VFXValue <Vector4>(this, mode));
            }
            return(null);
        }
Exemplo n.º 3
0
        static protected VFXExpression ToVFXValue(object[] input, VFXValue.Mode mode)
        {
            if (input[0] is int)
            {
                if (input.Length != 1)
                {
                    throw new InvalidOperationException("VFXExpressionMathOperation : Unexpected size of int");
                }
                return(new VFXValue <int>((int)input[0], mode));
            }
            else if (input[0] is uint)
            {
                if (input.Length != 1)
                {
                    throw new InvalidOperationException("VFXExpressionMathOperation : Unexpected size of uint");
                }
                return(new VFXValue <uint>((uint)input[0], mode));
            }
            else if (input[0] is bool)
            {
                if (input.Length != 1)
                {
                    throw new InvalidOperationException("VFXExpressionMathOperation : Unexpected size of bool");
                }
                return(new VFXValue <bool>((bool)input[0], mode));
            }
            else if (input[0] is float)
            {
                if (input.OfType <float>().Count() != input.Length)
                {
                    throw new InvalidOperationException("VFXExpressionMathOperation : Unexpected type of float among other float");
                }

                switch (input.Length)
                {
                case 1: return(new VFXValue <float>((float)input[0], mode));

                case 2: return(new VFXValue <Vector2>(new Vector2((float)input[0], (float)input[1]), mode));

                case 3: return(new VFXValue <Vector3>(new Vector3((float)input[0], (float)input[1], (float)input[2]), mode));

                case 4: return(new VFXValue <Vector4>(new Vector4((float)input[0], (float)input[1], (float)input[2], (float)input[3]), mode));
                }
            }
            return(null);
        }
Exemplo n.º 4
0
 sealed public override VFXValue DefaultExpression(VFXValue.Mode mode)
 {
     return(new VFXValue <uint>(0u, mode));
 }
Exemplo n.º 5
0
 public override VFXValue DefaultExpression(VFXValue.Mode mode)
 {
     return(new VFXValue <Matrix4x4>(Matrix4x4.identity, mode));
 }
 public override VFXValue DefaultExpression(VFXValue.Mode mode)
 {
     return(new VFXTextureCubeValue(null, mode));
 }
Exemplo n.º 7
0
 sealed public override VFXValue DefaultExpression(VFXValue.Mode mode)
 {
     return(new VFXValue <Vector3>(Vector3.forward, mode));
 }
Exemplo n.º 8
0
 public override VFXValue DefaultExpression(VFXValue.Mode mode)
 {
     return(new VFXValue <Vector3>(Vector3.zero, mode));
 }
 public override VFXValue DefaultExpression(VFXValue.Mode mode)
 {
     return(new VFXValue <Mesh>(null, mode));
 }
Exemplo n.º 10
0
 public override VFXValue DefaultExpression(VFXValue.Mode mode)
 {
     return(new VFXValue <bool>(false, mode));
 }
Exemplo n.º 11
0
 public override VFXValue DefaultExpression(VFXValue.Mode mode)
 {
     return(new VFXGraphicsBufferValue(0, mode));
 }
 public override VFXValue DefaultExpression(VFXValue.Mode mode)
 {
     return(new VFXValue <AnimationCurve>(new AnimationCurve(), mode));
 }
 public override VFXValue DefaultExpression(VFXValue.Mode mode)
 {
     return(new VFXValue <Gradient>(new Gradient(), mode));
 }
Exemplo n.º 14
0
 public virtual VFXValue DefaultExpression(VFXValue.Mode mode)
 {
     return(null);
 }
 public override VFXValue DefaultExpression(VFXValue.Mode mode)
 {
     return(new VFXSkinnedMeshRendererValue(0, mode));
 }
Exemplo n.º 16
0
 public override VFXValue DefaultExpression(VFXValue.Mode mode)
 {
     return(new VFXTexture2DValue(0, mode));
 }
Exemplo n.º 17
0
 sealed public override VFXValue DefaultExpression(VFXValue.Mode mode)
 {
     return(new VFXValue <float>(0.0f, mode));
 }