摘要: public void GetRay(){ public float range = 100f; Ray shootRay = new Ray(); RaycastHit shootHit; int shootableMask; shootableMask = LayerMask.GetMask... 阅读全文
posted @ 2019-05-24 10:55 玄~轩逸 阅读(187) 评论(0) 推荐(0) 编辑
摘要: using UnityEngine; using System.Collections; using System; using System.Net; using System.Net.Mail; using System.Net.Security; using System.Security.Cryptography.X509Certificates; public class... 阅读全文
posted @ 2019-05-24 10:55 玄~轩逸 阅读(433) 评论(0) 推荐(0) 编辑
摘要: //解析和输出XML public void showXml() { string filepath = Application.dataPath + @"/my.xml"; if(File.Exists (filepath)) { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(filepath); ... 阅读全文
posted @ 2019-05-24 10:54 玄~轩逸 阅读(187) 评论(0) 推荐(0) 编辑
摘要: //第1种实现方式 public class Singleton { private static Singleton Instance=null; private Singleton(){} public static Singleton GetInstance() { if(Ins... 阅读全文
posted @ 2019-05-24 10:54 玄~轩逸 阅读(1200) 评论(0) 推荐(0) 编辑
摘要: 15:17 2019/5/10 //第一种 using UnityEngine; using System.Collections; //引入库 using System.Net; using System.Net.Sockets; using System.Text; using System.T 阅读全文
posted @ 2019-05-24 10:53 玄~轩逸 阅读(5144) 评论(0) 推荐(0) 编辑
摘要: //解复杂json文件 public void GetJsonInfo() { string filename = Application.streamingAssetsPath + "/data.json"; string str = File.ReadAllText(filename); Jso 阅读全文
posted @ 2019-05-24 10:51 玄~轩逸 阅读(2029) 评论(0) 推荐(0) 编辑
摘要: 以上是具体实现代码 具体实现方法: 通过射线判断确定点击的是哪一部分 阅读全文
posted @ 2019-05-24 10:49 玄~轩逸 阅读(286) 评论(0) 推荐(0) 编辑
摘要: 问题: 怎么让当手指滑动的同时对应的模型发生旋转 解决办法: 1:通过控制摄像机或者模型来实现效果 2:通过获取鼠标移动时X轴Y轴的偏移量来确定模型的旋转角度 3:为了不让人感觉到突兀,建议使用Mathf.SmoothDamp方法实现角度的改变 实现代码如下: 阅读全文
posted @ 2019-05-24 10:47 玄~轩逸 阅读(927) 评论(0) 推荐(0) 编辑
摘要: 方法:使用RawImage通过Render Texter将摄像机下的物体渲染纹理记录并显示在RawImage上面 具体实现:新建一个模型(Cube),新建一个摄像机,将Clear Flags设置为Solid Color只显示模型,位置与模型一致(Z值除外),UI上新建RawImage,在创建Rend 阅读全文
posted @ 2019-05-24 10:43 玄~轩逸 阅读(4872) 评论(0) 推荐(0) 编辑