原创 shader 圓形遮罩
unity 遮罩,用mask 試了試 沒啥效果,於是上網找了關於shader遮罩的博客。效果還不錯。 圓形裁剪。 步驟: 1. shader:其主要原理是把遮罩圖片的透明和原圖片的透明度進行混合。不透明部分就是遮罩區域,透明部分不再顯
原创 unity 和webgl 互調傳值
unity 調用web 並傳值 : 1.在unity發佈webgl文件中找到index.html文件 2.在index.html 定義unity要調用的函數 function MyFunction1(arg,arg2
原创 unity csv 文件讀取 工具封裝
這套封裝可以通過讀取不同的csv文件,根據不同的枚舉類型獲取對應的數據 using SevenG; using System; using System.Collections; using System.Collections.
原创 unity 位置 管理
資源下載 http://download.csdn.net/download/tianyongheng/10161641 場景中生成的一些輔助點,佔用,回收等功能.有demo可以下載,細節就不講了 using System; u
原创 unity icon 面向相機
unity 場景中圖標始終面向相機 using System.Collections; using System.Collections.Generic; using UnityEngine; public class Icon
原创 unity 鼠標移動 縮放,旋轉
2018-11-25修改:加入防止UI穿透,如果相機有PhysicsRaycaster組件,考慮檢測到UI是否向下傳遞給3D物體 這時使用 EventSystem.current.IsPointerOverGameObject(
原创 unity 常用的幾種解析json方式
目前接觸的unity 解析json 有幾種: 1.比較流行的listjson(數據對象必須和json一對一) 2.目前unity自帶 JsonUtility(不能解析複雜的json) 3.Newtonsoft.Json (推
原创 Unity 發佈webgl 網頁自適應
unity 發佈webgl後找到index.html 然後在 head 裏添加 代碼 <head> <script> function Reset() { var canvas = docu
原创 異步下載思路
unity異步下載數據的一些思路
原创 計算曲線
using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class CusCurve {
原创 UI曲線跟着目標點 旋轉,拉伸縮放
//1. lineRoot是線的跟節點,所有的點組成線 //2 lineRoot起點的座標(lineRoot的位置==起點 條件是lineRoot中心重合)=sart //3.lineRoot終點= lineEndPoint //4
原创 unity ugui 畫曲線 跟隨目標點縮放旋轉 曲線終點和目標點保持一致
unity 畫曲線 兩種方式 一是生成點,由點組成線,比較消耗內存 點組成曲線的Demo 下載地址:https://download.csdn.net/download/tianyongheng/10423694 1.新建Pane
原创 unity 異步加載圖片2
using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class ImgPackage {
原创 unity 生成圓形 方法
using UnityEngine; using System; using System.Collections.Generic; public class DrawCircle : MonoBehaviour { publi
原创 地圖座標2D映射3D地圖場景中
1.採集數據的地圖mapData(名稱),地圖 長、寬: L,W 2.unity 需要一張地圖map(名稱) 長、寬:L/N,W/N (N 是縮放係數,和數據採集的地圖保持比例 不能壓縮變形) unity 中的地圖是3D模型 還是是2