Unity技巧集合3

Posted stalendp

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Unity技巧集合3相关的知识,希望对你有一定的参考价值。

1. Node.js读取Excel文本相关

https://www.npmjs.com/package/read-excel-file

2. 血条位置更新:
相关参考:RectTransformUtility

// 更新血条位置
void LateUpdate() 
    var sPos = RectTransformUtility.WorldToScreenPoint(Camera.main, ch.transform.position);
    var pos = Vector2.zero;
    if (RectTransformUtility.ScreenPointToLocalPointInRectangle(pTrans, sPos, null, out pos)) 
        curTrans.anchoredPosition = pos;
    

3. 代码中有个死循环,怎么调试

在C++调试模式下中断程序,并人为制造异常,然后Unity就会打印出堆栈,具体如下:

https://blogs.unity3d.com/2016/05/24/breakout-how-to-stop-an-infinite-loop-in-a-unity-c-script/

 

 

以上是关于Unity技巧集合3的主要内容,如果未能解决你的问题,请参考以下文章

Unity3D数据集合数组集合Array学习

Unity3D数据集合数组集合Array学习

Unity3D数据集合链表LinkedList数据集合学习

Unity3D数据集合链表LinkedList数据集合学习

Unity3D数据集合列表集合List及ListArray学习

Unity3D数据集合列表集合List及ListArray学习