Beispiel #1
0
        public Entity AddVector4(UnityEngine.Vector4 newVector4)
        {
            var component = new Vector4Component();

            component.vector4 = newVector4;
            return(AddVector4(component));
        }
 public Entity ReplaceVector4(UnityEngine.Vector4 newVector4)
 {
     Vector4Component component;
     if (hasVector4) {
         WillRemoveComponent(ComponentIds.Vector4);
         component = vector4;
     } else {
         component = new Vector4Component();
     }
     component.vector4 = newVector4;
     return ReplaceComponent(ComponentIds.Vector4, component);
 }
Beispiel #3
0
        public Entity ReplaceVector4(UnityEngine.Vector4 newVector4)
        {
            Vector4Component component;

            if (hasVector4)
            {
                WillRemoveComponent(ComponentIds.Vector4);
                component = vector4;
            }
            else
            {
                component = new Vector4Component();
            }
            component.vector4 = newVector4;
            return(ReplaceComponent(ComponentIds.Vector4, component));
        }
 public Entity AddVector4(UnityEngine.Vector4 newVector4)
 {
     var component = new Vector4Component();
     component.vector4 = newVector4;
     return AddVector4(component);
 }
 public Entity AddVector4(Vector4Component component)
 {
     return AddComponent(ComponentIds.Vector4, component);
 }
Beispiel #6
0
 public Entity AddVector4(Vector4Component component)
 {
     return(AddComponent(ComponentIds.Vector4, component));
 }
        public static float GetComponent( this Vector4 vec4, Vector4Component com )
        {
            switch ( com )
            {
            case Vector4Component.X:
                return vec4.X;

            case Vector4Component.Y:
                return vec4.Y;

            case Vector4Component.Z:
                return vec4.Z;

            case Vector4Component.W:
                return vec4.W;

            default:
                throw new EnumException<Vector4Component>( nameof( com ), com );
            }
        }
        public static Vector4 ChangeComponent( this Vector4 vec4, Vector4Component com, float value )
        {
            switch ( com )
            {
            case Vector4Component.X:
                vec4.X = value;
                break;

            case Vector4Component.Y:
                vec4.Y = value;
                break;

            case Vector4Component.Z:
                vec4.Z = value;
                break;

            case Vector4Component.W:
                vec4.W = value;
                break;

            default:
                throw new EnumException<Vector4Component>( nameof( com ), com );
            }

            return vec4;
        }