private Vector3 InvertAxes(Vector3 value, EAxis axis)
        {
            if (axis.HasFlag(EAxis.X))
            {
                value = new Vector3(-value.x, value.y, value.z);
            }
            if (axis.HasFlag(EAxis.Y))
            {
                value = new Vector3(value.x, -value.y, value.z);
            }
            if (axis.HasFlag(EAxis.Z))
            {
                value = new Vector3(value.x, value.y, -value.z);
            }

            return(value);
        }
        private Vector3 UpdateFollowingAxes(Vector3 value, EAxis axis)
        {
            if (!axis.HasFlag(EAxis.X))
            {
                value = new Vector3(0, value.y, value.z);
            }
            if (!axis.HasFlag(EAxis.Y))
            {
                value = new Vector3(value.x, 0, value.z);
            }
            if (!axis.HasFlag(EAxis.Z))
            {
                value = new Vector3(value.x, value.y, 0);
            }

            return(value);
        }
        public static void Flip(this Transform t, EAxis direction)
        {
            Vector3 scale = t.localScale;

            if (direction.HasFlag(EAxis.X))
            {
                scale.x *= -1.0f;
            }
            if (direction.HasFlag(EAxis.Y))
            {
                scale.y *= -1.0f;
            }
            if (direction.HasFlag(EAxis.Z))
            {
                scale.z *= -1.0f;
            }
            t.localScale = scale;
        }
        private Vector3 UpdateFollowingAxes(Vector3 firstValue, Vector3 secondValue, EAxis axis)
        {
            Vector3 value = (firstValue + secondValue) / 2;

            if (!axis.HasFlag(EAxis.X))
            {
                value = new Vector3(0, (firstValue.y + secondValue.y) / 2, (firstValue.z + secondValue.z) / 2);
            }
            if (!axis.HasFlag(EAxis.Y))
            {
                value = new Vector3((firstValue.x + secondValue.x) / 2, 0, (firstValue.x + secondValue.x) / 2);
            }
            if (!axis.HasFlag(EAxis.Z))
            {
                value = new Vector3((firstValue.x + secondValue.x) / 2, (firstValue.y + secondValue.y) / 2, 0);
            }

            return(value);
        }