Unity Vector3扩展(*)重载

时间:2021-08-29 20:35:47   收藏:0   阅读:5
/// <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);
}

原文:https://www.cnblogs.com/godshadow/p/15196515.html

评论(0)
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!