SerializableVector3 Just a hint

Hi All,

To anyone using the SerializableVector3, after implementing it in a couple of places in my own project it gets really old converting back and forth especially for Quaternion, I would suggest adding the following implicit conversion operators to that class. and that is all

        public static implicit operator Vector3( SerializableVector3 instance ){
            return instance.ToVector();
        }
        
        public static implicit operator SerializableVector3 ( Vector3 vector )
        {
            return new SerializableVector3(vector);
        }
        
        public static implicit operator Quaternion( SerializableVector3 instance ){
            return  Quaternion.Euler(instance.ToVector());
        }
        
        public static implicit operator SerializableVector3 ( Quaternion quaternion )
        {
            return new SerializableVector3(quaternion.eulerAngles);
        }

An excellent suggestion!

For other readers, here’s a bit more on creating implicit operators How to use implicit and explicit operators in C# | InfoWorld