原创 通用的EventTriggerListener事件監聽
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems;
原创 非常好用的事件派發系統
using System.Collections; using System.Collections.Generic; using UnityEngine; using System; public delegate void Eve
原创 監聽動畫結束的幾種方式
監聽動畫結束的幾種方式 1.通過Animation手動添加關鍵幀; 2.通過Invoke方法傳入方法名稱和動畫時長; 3.通過定時器來監聽 4.通過代碼綁定 using UnityEngine; public class Test :
原创 unity UI交互檢測
檢測鼠標是否在某個UI的RectTransform上: RectTransform myRect = GetComponent<RectTransform>(); bool isContain = RectTransformUtil
原创 轉 C# 託管內存與非託管內存之間的轉換
1.c#的託管代碼和非託管代碼 c#有自己的內存回收機制,所以在c#中我們可以只new,不用關心怎樣delete,c#使用gc來清理內存,這部分內存就是managed memory,大部分時候我們工作於c#環境中,都是在使用託管內存,然而