2016年10月19日

Unity3D寻找被隐藏的物体

摘要: 给隐藏的物体添加主物体(空物体)GameObject x = GameObject.Find("主物体");GameObject y = x.transform.Find("隐藏的物体").gameObject; 阅读全文

posted @ 2016-10-19 21:47 3137102247 阅读(568) 评论(0) 推荐(0) 编辑

Unity3D File类方法调用出错解决方法

摘要: File不适用WEBPLAYER平台,平台在BULIDSETTING修改。 阅读全文

posted @ 2016-10-19 13:35 3137102247 阅读(224) 评论(0) 推荐(0) 编辑

Unity3D 新版本场景转换

摘要: File->Build Settings ->AddSence 调用UnityEngine.SceneManagement.SceneManager.LoadScene (场景序列号); 阅读全文

posted @ 2016-10-19 13:34 3137102247 阅读(169) 评论(0) 推荐(0) 编辑

Unity3D鼠标点击处

摘要: if (Input.GetMouseButton(1)){//鼠标右键点击 Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);//发射红外线 RaycastHit hit; //定义信息获取器 if (Physics.Raycas 阅读全文

posted @ 2016-10-19 13:33 3137102247 阅读(169) 评论(0) 推荐(0) 编辑

Unity3D静态AI自动寻路

摘要: Window → NavigationMeshRenders(障碍物)选择障碍物 Navigation Static打勾Terrains(地形)选择地形 Navigation Static打勾点Bake栏的Bake,烘培地形。给寻路角色添加 Component → Navigation →Nav M 阅读全文

posted @ 2016-10-19 13:32 3137102247 阅读(364) 评论(0) 推荐(0) 编辑

Unity3D 雷达检测器

摘要: Collider[] cols = Physics.OverlapSphere (坐标,半径,layer);//雷达检测 阅读全文

posted @ 2016-10-19 13:31 3137102247 阅读(375) 评论(0) 推荐(0) 编辑

Unity3D重新加载光线变暗问题

摘要: Window -> Lighting 把AUTO的勾去掉,再Bake一下! 阅读全文

posted @ 2016-10-19 13:30 3137102247 阅读(262) 评论(0) 推荐(0) 编辑

Unity3D切换场景不销毁物体

摘要: DontDestroyOnLoad(gameObject); 阅读全文

posted @ 2016-10-19 13:29 3137102247 阅读(818) 评论(0) 推荐(0) 编辑

Unity3D 视频播放

摘要: 视频播发有两种方法:(1)plane上using UnityEngine;using System.Collections; public class Test: MonoBehaviour{ //电影纹理 public MovieTexture movTexture; void Start() { 阅读全文

posted @ 2016-10-19 13:28 3137102247 阅读(171) 评论(0) 推荐(0) 编辑

Unity3D 平滑转向

摘要: Quaternion rotate = Quaternion.LookRotation(目标.position - transform.position); transform.rotation = Quaternion.Slerp(transform.rotation, rotate, Time. 阅读全文

posted @ 2016-10-19 13:28 3137102247 阅读(647) 评论(0) 推荐(0) 编辑

Unity3D之Camera跟随鼠标移动,右键显示或隐藏鼠标

摘要: using UnityEngine; using System.Collections; public class FreeCamera : MonoBehaviour { private float mouseX; private float mouseY; private bool isShow; public float rotateSpeed;//旋... 阅读全文

posted @ 2016-10-19 13:20 3137102247 阅读(466) 评论(0) 推荐(0) 编辑

Unity3d存档例子

摘要: 这是场景存储的信息类,创建好不管它 using UnityEngine; using System.Collections; [SerializeField]public class Sence//场景存储的变量放这个类里 { Public Vector3 cubePosion; //Cube位置信 阅读全文

posted @ 2016-10-19 13:14 3137102247 阅读(7528) 评论(0) 推荐(0) 编辑

导航