-
大小: 13.84MB文件類型: .zip金幣: 1下載: 0 次發布日期: 2023-07-13
- 語言: 其他
- 標簽: Navigation??
資源簡介
unity的Navigation尋路例子,完整的例子.
包含了所有的使用方法,跳躍,爬梯子,角色動作的切換行云流水,值得收藏
unity,untiy3d,u3d,Navigation,Nav mesh agent
代碼片段和文件信息
using?UnityEngine;
using?System.Collections;
[RequireComponent?(typeof?(NavMeshAgent))]
public?class?DoorClient?:?MonoBehaviour
{
private?NavMeshAgent?navMeshAgent;
void?Start()?{
navMeshAgent?=?GetComponent();
}
public?bool?PassingThrough(Vector4?plane)?{
NavMeshHit?hit;
navMeshAgent.SamplePathPosition(-1?2.5f?out?hit);
if(hit.distance==0.0f)?return?false;
Vector3?next_pos?=?hit.position;
Vector3?curr_pos?=?transform.position;
//?Test?positions?are?on?opposite?sides?of?door?plane.
float?s1?=?Vector3.Dot(next_pos?plane)?+?plane.w;
float?s2?=?Vector3.Dot(curr_pos?plane)?+?plane.w;
return?s1*s2<0.0f;
}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2011-12-22?12:58??NavMeshExample35b7\
?????目錄???????????0??2011-12-21?14:21??NavMeshExample35b7\Assets\
?????文件????????6148??2011-12-21?13:04??NavMeshExample35b7\Assets\.DS_Store
?????目錄???????????0??2011-12-21?13:14??NavMeshExample35b7\Assets\Gizmos\
?????文件????????2818??2011-12-17?17:06??NavMeshExample35b7\Assets\Gizmos\BlueFlag32.png
?????文件?????????663??2011-12-17?17:06??NavMeshExample35b7\Assets\Gizmos\BlueFlag32.png.me
?????文件????????2754??2011-12-21?13:07??NavMeshExample35b7\Assets\Gizmos\GreenFlag32.png
?????文件?????????663??2011-12-21?13:08??NavMeshExample35b7\Assets\Gizmos\GreenFlag32.png.me
?????文件????????2697??2011-12-17?17:06??NavMeshExample35b7\Assets\Gizmos\RedFlag32.png
?????文件?????????663??2011-12-17?17:07??NavMeshExample35b7\Assets\Gizmos\RedFlag32.png.me
?????文件??????????60??2011-12-17?16:49??NavMeshExample35b7\Assets\Gizmos.me
?????目錄???????????0??2011-12-21?14:19??NavMeshExample35b7\Assets\Materials\
?????目錄???????????0??2011-12-17?18:03??NavMeshExample35b7\Assets\Materials\Block\
?????文件????????4216??2011-12-17?18:03??NavMeshExample35b7\Assets\Materials\Block\BlockBlue.mat
?????文件??????????60??2011-12-17?17:07??NavMeshExample35b7\Assets\Materials\Block\BlockBlue.mat.me
?????文件????????4216??2011-12-17?17:06??NavMeshExample35b7\Assets\Materials\Block\BlockDark.mat
?????文件??????????60??2011-12-17?17:07??NavMeshExample35b7\Assets\Materials\Block\BlockDark.mat.me
?????文件????????4216??2011-12-17?17:06??NavMeshExample35b7\Assets\Materials\Block\BlockGray.mat
?????文件??????????60??2011-12-17?17:07??NavMeshExample35b7\Assets\Materials\Block\BlockGray.mat.me
?????文件????????4216??2011-12-17?18:03??NavMeshExample35b7\Assets\Materials\Block\BlockRed.mat
?????文件??????????60??2011-12-17?16:49??NavMeshExample35b7\Assets\Materials\Block\BlockRed.mat.me
?????文件??????????60??2011-12-17?16:49??NavMeshExample35b7\Assets\Materials\Block.me
?????文件????????4208??2011-12-17?17:06??NavMeshExample35b7\Assets\Materials\Blue.mat
?????文件??????????60??2011-12-17?17:07??NavMeshExample35b7\Assets\Materials\Blue.mat.me
?????文件????????4216??2011-12-20?21:21??NavMeshExample35b7\Assets\Materials\defaultMat.mat
?????文件??????????60??2011-12-20?21:21??NavMeshExample35b7\Assets\Materials\defaultMat.mat.me
?????文件????????4212??2011-12-20?14:12??NavMeshExample35b7\Assets\Materials\Green.mat
?????文件??????????60??2011-12-20?14:11??NavMeshExample35b7\Assets\Materials\Green.mat.me
?????文件????????4208??2011-12-17?17:06??NavMeshExample35b7\Assets\Materials\Red.mat
?????文件??????????60??2011-12-17?17:07??NavMeshExample35b7\Assets\Materials\Red.mat.me
?????文件??????????60??2011-12-17?16:49??NavMeshExample35b7\Assets\Materials.me
............此處省略264個文件信息
評論
共有 條評論