围绕旋转

围绕一个物体旋转

public GameObject point;

float aa = 0.5f;

void Update()

{

    transform.RotateAround(point,transform.position,Vector2.up,aa);

    //transfrom.RotateAround()围绕旋转,把物体拉入主相机里

}

摄像机围绕一款产品旋转一周或者两周

//第一种表示方法

public GameObject point;

public GameObject F;

float aa = 0.5f;

void Update()

{

    if(F.transfrom.eulerAngles.y <= 360f && F.transform.eulerAngles.y >= 0)

    {

        transform.RotateAround(point.transform.position,Vector3.up,aa);

    }

}

//第二种表示方法

public GameObject point;

public GameObject F;

float aa = 0.5f;

void Update()

{

    transform.RotateAround(point.transform.position,Vector3.up,aa);

    if(F.transform.eulerAngles.y >= 360f)

    {

        aa = 0;

    }

}


你可能感兴趣的:(Unity3D)