コード例 #1
0
        public static Vector4 ApplyKSVector4(this Vector4 v, KS.SceneActions.Vector4 config)
        {
            v.x = config.X ?? v.x;
            v.y = config.Y ?? v.y;
            v.z = config.Z ?? v.z;
            v.w = config.W ?? v.w;

            return(v);
        }
コード例 #2
0
        public static KS.SceneActions.Vector4 ToKSVector4(this Color c)
        {
            var config = new KS.SceneActions.Vector4
            {
                X = c.r,
                Y = c.g,
                Z = c.b,
                W = c.a,
            };

            return(config);
        }
コード例 #3
0
        public static KS.SceneActions.Vector4 ToKSVector4(this Rect r)
        {
            var config = new KS.SceneActions.Vector4
            {
                X = r.x,
                Y = r.y,
                Z = r.width,
                W = r.height,
            };

            return(config);
        }
コード例 #4
0
        public static Rect ApplyKSVector4(this Rect r, KS.SceneActions.Vector4 config)
        {
            if (config.X.HasValue)
            {
                r.x = config.X.Value;
            }
            if (config.Y.HasValue)
            {
                r.x = config.Y.Value;
            }
            if (config.Z.HasValue)
            {
                r.width = config.Z.Value;
            }
            if (config.W.HasValue)
            {
                r.height = config.W.Value;
            }

            return(r);
        }
コード例 #5
0
        public static Color ApplyKSVector4(this Color c, KS.SceneActions.Vector4 config)
        {
            if (config.X.HasValue)
            {
                c.r = config.X.Value;
            }
            if (config.Y.HasValue)
            {
                c.g = config.Y.Value;
            }
            if (config.Z.HasValue)
            {
                c.b = config.Z.Value;
            }
            if (config.W.HasValue)
            {
                c.a = config.W.Value;
            }

            return(c);
        }