Unity Vector3扩展(*)重载

/// <summary>
/// 重载运算符 向量3相乘
/// </summary>
public class Vector3Multiply
{
    public float x { get; private set; }
    public float y { get; private set; }
    public float z { get; private set; }


    public Vector3Multiply(float x, float y, float z)
    {
        this.x = x;
        this.y = y;
        this.z = z;
    }


    public static Vector3 operator *(Vector3Multiply a, Vector3Multiply b) => new Vector3(a.x * b.x, a.y * b.y, a.z * b.z);
}
posted @ 2021-08-28 12:12  yassine  阅读(309)  评论(0编辑  收藏  举报