- 博客(25)
- 资源 (55)
- 收藏
- 关注
原创 [unity]2D实现3D效果不正常
摄像机 在 远景,2D图片放在3D场景效果不正常,图片失真,不正常。2D图片为了在 3D 物体上 ,2D图片材质球,先是放在3D物体 Quad,2DSprite上,位于3D 场景中,摄像机远景 查看,有问题。2D图片材质球多试试几个3D物体Plane...
2021-04-30 15:09:38 488 1
原创 [Unity]平台#define指令代码过多编译错误
平台#define指令代码过多,打包后编译错误,代码不正常。...#if UNITY_EDITOR...#elif UNITY_ANDROID...#endif...多用#region命令来 整理代码,有的是缺}导致代码不正常。...#if UNITY_EDITOR...#elif UNITY_ANDROID... #region ... #endregion ... #region ... ...
2021-04-28 17:57:59 201
原创 [Unity]PoolManager的预制体已经在spawnPool中存在的问题
Exception: Prefab 'testPrefab (UnityEngine.Transform)' is already in SpawnPool 'pool'. Prefabs can be in more than 1 SpawnPool but cannot be in the same SpawnPool twice.问题poolManager初始化 spawnPool后,场景中 的物体 的脚本 在 Start函数中进行调用,与PoolManager相互冲突。解决...
2021-04-28 15:04:00 370
原创 [Unity][Camera]判断物体是否在摄像机 范围内的几个方法
判断物体是否Game视图主摄像机范围内... private void Update() { Vector3 viewPos = Camera.main.WorldToViewportPoint(this.transform.position);//在摄像机范围外 if (viewPos.x >= 0 && viewPos.x <= 1 && viewPos.y >= 0 &am...
2021-04-28 11:36:40 3745
原创 [Unity]场景放大100倍导致摄像机的场景模型失真
场景模型 放大 100倍,摄像机 为了 看到 模型 显示不正常。Projection为Perspective模式。调整MainCamera的Clipping Planes 的 Far不要超过10000和Near的值不要过小、小于0.001Field of View的值越高,MainCamera的Y的值可以越低。在这几个属性调整数值。...
2021-04-27 18:12:55 460
原创 [Unity]代码动态添加GameObject的Layer并用摄像机进行屏蔽
using System.Collections;using System.Collections.Generic;using UnityEngine;public class TestLayer : MonoBehaviour{ void Start() { string layerName = "TestLayer"; TagManagerAutoAdd.AutoAddLayer(layerName); ...
2021-04-26 19:41:50 1241
原创 [Unity]获得GameObject的Layer
string layerName = "Build"; Debug.Log(LayerMask.NameToLayer(layerName)); Debug.Log(this.gameObject.layer);
2021-04-26 19:34:50 2394 1
原创 [Unity][UGUI][NGUI]小地图跳转摄像机坐标偏移值计算
... float height = this.transform.position.y; float rot_x = this.transform.eulerAngles.x; float a = Mathf.Tan((90 - rot_x) * Mathf.Deg2Rad) * height; print("a: " + a);...相关资料:1.[Unity][NGUI]NGUI精灵小地图点击跳...
2021-04-24 15:24:37 290
原创 [Unity]获得Inspector视图下Transform.Rotation的值
...float rot_z = ui_1.transform.eulerAngles.z//200.3266-360f;//-159.6734...
2021-04-23 10:44:31 717 1
原创 [Unity][UGUI][NGUI]地图指示UI屏幕边缘显示
UGUIeuler.z参考资料:1.Unity3D 世界坐标转屏幕坐标的坑2.在屏幕边缘指示怪物/敌人当前所处的方位3.
2021-04-22 19:36:11 652
原创 [Unity]如何解决大量的if语句或switch case语句
表驱动法查询表(ookup table)...Dictionary<string, bool> testDict = new Dictionary<string, bool>(){ ["key1"] = true, ["key2"] = false, ["测试"] = true};...if ( testDict.ContainsKey("测试"))//通过int变量 来查找 对应 的字符串 { bool value...
2021-04-21 17:59:00 900
原创 [Unity]PoolManager的基础使用以及应用
建立对象池代码新建对象池using System.Collections;using System.Collections.Generic;using UnityEngine;using PathologicalGames;... #region SpawnPool public SpawnPool pool_A; public SpawnPool pool_B; public SpawnPool pool_C; #endreg...
2021-04-20 19:05:14 1755 1
原创 [Unity]导入插件缺失命名空间
A插件能够在新建项目中正常使用。把A插件导入到项目中,这个项目中有多个插件,结果这个A插件的Editor里面的文件报错。The type or namespace name `A' could not be found.插件之间冲突。A插件里面位于Asset-Editor里面的文件有问题,如果不影响主要功能,删除,就没有缺失命名空间的错误。...
2021-04-19 17:37:51 822
原创 [Unity][射线检测]屏幕中心点摄像机发出一个射线与某平面相交的点
主摄像机 的 屏幕中心 方向 从主摄像机的世界坐标 为起点 发出 一条 射线,获得该射线 Y = 1 的平面 的 坐标的值...update(){...//从 摄像机 开始 向 屏幕中心 的2D 坐标 发射 射线 Ray ray = Camera.main.ScreenPointToRay(new Vector3(Screen.width / 2, Screen.height / 2, 0));//射线 RaycastHit hit; ...
2021-04-16 14:49:33 2659
原创 [Unity]A*寻路超出一定范围寻路没有效果
A*寻路 的 组件TileCreator的Width和Height最好是相等,如果寻址地图20*30,A*寻路的设置最好是30*30。
2021-04-16 10:35:28 194
原创 [Unity]一部分视图变黑
打开项目,突然看到某一块视图变黑,无响应。NullReferenceException: Object reference not set to an instance of an objectUnityEditor.GUIView.OnDisable () (at <e9274028962b41d3817c3a283d24f8d0>:0)UnityEditor.HostView.OnDisable () (at <e9274028962b41d3817c3a28...
2021-04-15 10:57:29 670
原创 [Unity]NavMesh地图地形数据转换为服务器数据
参考资料1 的项目源码 失效?参考资料2 可用参考资料3 可用参考资料4-5,需要CritterAI 插件。参考资料6CritterAI 插件官网,参考资料7 把NavMesh的地图数据 直接转换为Obj模型文件。参考资料:1.让Unity NavMesh为我所用2.将Unity导航网格(navmesh)模拟输出到二维数组并导出xml3.Unity3d开发(十三)导出NavMesh可行走区域信息4.Unity3d的NavMesh信息导出...
2021-04-12 18:02:32 1087
原创 [Unity]OnSceneGUI()函数没有反应
参考资料:1.[Unity2019]坑:OnDrawGizmos,OnSceneGUI2.3.
2021-04-10 15:22:33 2002
原创 [Unity]Game视图和Scene视图显示一样碰撞体的辅助线界面
偶然间 Game视图也显示了 和Scene 视图一样的 碰撞体的 边界以及 UGUI 的边框。当Gizmos选项都勾选当Scene视图选中Gizmos当Scene视图没有选中GizmosGame视图选中GizmosGame视图没有选中Gizmos当Gizmos选项都没有勾选...
2021-04-09 15:31:30 2980
原创 [Unity]Visual Studio没有提示
Edit-Preferences-External Tools - External Script Editor前提是vs在安装的时候,就已经勾选了 支持unity的相关 选项。
2021-04-08 18:12:50 489
原创 [Unity][NGUI]NGUI精灵小地图点击跳转
using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.EventSystems;public class NGUIMiniMap : MonoBehaviour{ public float width = 0;//NGUI按钮精灵 宽 public float height = 0;//NGUI按钮精灵 高 publ...
2021-04-08 17:25:44 532
原创 [Unity][AssetBundle]从AB包中加载Material材质球
...using UnityEditor;... public AssetBundle ab_material; public Material m;.../// <summary> /// 从 111 ab包中 获取 名字为test的材质 /// </summary> private void testGetMaterial() {string str_material = Application....
2021-04-03 16:15:21 1352
GtaV1.5apk
2017-12-25
泰拉瑞亚Terraria 全物品合成表
2017-12-20
Rimworld_A13之职业及特性
2017-12-20
UnityNavMeshComponents-master寻路组件动态自动烘培
2017-11-18
UnityGUI强大10多个统计DIY自定义组件分享
2017-11-15
[Unity][unet][Android]发送信息交互通讯的工程文件
2017-10-31
NetworkingTools_UnityProject_GameSparks_tut5
2017-06-20
VolumetricLinesUnity
2017-06-16
InputManager
2017-06-13
unity-json-master
2017-05-13
Volume 15 屏幕高斯模糊(Gaussian Blur)特效的实现
2017-04-16
Modified SpriteOutline.rar
2017-03-05
SpriteOutline.shader
2017-03-05
[Unity]在3D物体上播放帧动画
2021-10-27
EasyTouch 5.0.17.以及5.0.12和校验中问文档.rar
2021-08-25
HttpFileUploaderAndDownloader-master_123.rar
2021-08-14
UnityAndroidTakePhoto.rar
2021-08-09
FileUploaderAndDownloader
2021-08-05
RuntimePermissions.jar.src.zip
2021-08-04
Crowd Behavior - Unity3D Mall Simulation
2019-11-24
io_scene_fbx_277fixed
2019-02-14
Unity标准两足人形模型动作拓展
2019-02-12
Field-of-View-master
2018-02-04
OutlineEffectforUnity2D3D物体描边插件
2017-12-23
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人