摘要:给隐藏的物体添加主物体(空物体)GameObject x = GameObject.Find("主物体");GameObject y = x.transform.Find("隐藏的物体").gameObject;
阅读全文
摘要:File不适用WEBPLAYER平台,平台在BULIDSETTING修改。
阅读全文
摘要:File->Build Settings ->AddSence 调用UnityEngine.SceneManagement.SceneManager.LoadScene (场景序列号);
阅读全文
摘要:if (Input.GetMouseButton(1)){//鼠标右键点击 Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);//发射红外线 RaycastHit hit; //定义信息获取器 if (Physics.Raycas
阅读全文
摘要:Window → NavigationMeshRenders(障碍物)选择障碍物 Navigation Static打勾Terrains(地形)选择地形 Navigation Static打勾点Bake栏的Bake,烘培地形。给寻路角色添加 Component → Navigation →Nav M
阅读全文
摘要:Collider[] cols = Physics.OverlapSphere (坐标,半径,layer);//雷达检测
阅读全文
摘要:Window -> Lighting 把AUTO的勾去掉,再Bake一下!
阅读全文
摘要:DontDestroyOnLoad(gameObject);
阅读全文
摘要:视频播发有两种方法:(1)plane上using UnityEngine;using System.Collections; public class Test: MonoBehaviour{ //电影纹理 public MovieTexture movTexture; void Start() {
阅读全文
摘要:Quaternion rotate = Quaternion.LookRotation(目标.position - transform.position); transform.rotation = Quaternion.Slerp(transform.rotation, rotate, Time.
阅读全文
摘要:using UnityEngine; using System.Collections; public class FreeCamera : MonoBehaviour { private float mouseX; private float mouseY; private bool isShow; public float rotateSpeed;//旋...
阅读全文
摘要:这是场景存储的信息类,创建好不管它 using UnityEngine; using System.Collections; [SerializeField]public class Sence//场景存储的变量放这个类里 { Public Vector3 cubePosion; //Cube位置信
阅读全文