![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
unity
BootGame
游戏开发爱好者
展开
-
Unity中局部坐标与世界坐标的相互转化
局部坐标转为世界坐标此时son是parent的子物体,并且son此时的局部坐标为(2,0,0)此时我们利用脚本将son的世界坐标输出using System.Collections;using System.Collections.Generic;using UnityEngine;public class Test : MonoBehaviour{ // Start is called before the first frame update void Start()原创 2022-05-09 23:03:55 · 4492 阅读 · 0 评论 -
unity实现简单fps游戏功能
unity实现简单fps游戏鼠标功能1.unity实现瞄准镜功能实现原理按下鼠标右键镜头拉近,再次按下镜头拉远(设置Camrea的FOV属性)逐渐拉近(例如:60->20逐渐拉近)设置缩放等级使每次点击的缩放效果不同public class ScaleCamera : MonoBehaviour{ private bool isFar=true; private Camera cam; private int[] zoomLength = { 60,40,20原创 2022-04-02 20:08:50 · 4422 阅读 · 0 评论