#pragma strict
private var agent : NavMeshAgent;
private var animator : Animator;
private var ridden = false;
function Awake() {
agent = GetComponent.<NavMeshAgent>();
animator = GetComponent.<Animator>();
agent.updateRotation = false;
}
function SetConfig(alt : boolean) {
var entranceName = alt ? "Entrance 2" : "Entrance 1";
agent.SetDestination(GameObject.Find(entranceName).transform.position);
if (alt) gameObject.layer++;
}
function Start() {
while (!ridden) {
var speed = agent.velocity.magnitude;
animator.SetFloat("speed", speed);
if (speed > 0.1) {
var rotation = Quaternion.LookRotation(agent.velocity);
transform.rotation = ExpEase.Out(transform.rotation, rotation, -4.0);
}
yield;
}
}
function RideOnEscalator(entrance : Vector3, target : Vector3, escalatorSpeed : float, animSpeed : float) {
ridden = true;
agent.enabled = false;
collider.enabled = false;
var rotation = Quaternion.LookRotation(Vector3.Scale(target - entrance, Vector3(1, 0, 1)));
for (var time = 0.0; time < 0.5; time += Time.deltaTime) {
transform.position = ExpEase.Out(transform.position, entrance, -4.0);
transform.rotation = ExpEase.Out(transform.rotation, rotation, -4.0);
animator.SetFloat("speed", animSpeed, 0.2, Time.deltaTime);
yield;
}
while ((target - transform.position).magnitude > 0.1) {
transform.position = Vector3.MoveTowards(transform.position, target, escalatorSpeed * Time.deltaTime);
yield;
}
Destroy(gameObject);
}
没有合适的资源?快使用搜索试试~ 我知道了~
使用Unity的人群模拟示例。___下载.zip
共87个文件
meta:43个
asset:15个
fbx:6个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 191 浏览量
2023-04-16
20:23:15
上传
评论
收藏 13.91MB ZIP 举报
温馨提示
使用Unity的人群模拟示例。___下载.zip
资源推荐
资源详情
资源评论
收起资源包目录
使用Unity的人群模拟示例。___下载.zip (87个子文件)
unity-crowd-simulation-master
Extra
Room.jas 20KB
ProjectSettings
DynamicsManager.asset 4KB
TimeManager.asset 4KB
AudioManager.asset 4KB
NavMeshLayers.asset 9KB
NetworkManager.asset 4KB
QualitySettings.asset 3KB
EditorBuildSettings.asset 4KB
TagManager.asset 741B
EditorSettings.asset 295B
InputManager.asset 5KB
ProjectSettings.asset 15KB
Assets
Scripts.meta 90B
Characters.meta 90B
Scenes
Evacuation.meta 90B
Escalator.unity 38KB
Evacuation.unity 1.17MB
Escalator
LightmapFar-0.exr.meta 707B
NavMesh.asset 6KB
LightProbes.asset 5KB
LightmapFar-0.exr 773KB
LightmapFar-1.exr.meta 707B
LightProbes.asset.meta 95B
NavMesh.asset.meta 95B
LightmapFar-1.exr 157KB
Escalator.unity.meta 90B
Evacuation
LightmapFar-0.exr.meta 707B
NavMesh.asset 25KB
LightProbes.asset 5KB
LightmapFar-0.exr 958KB
LightProbes.asset.meta 95B
NavMesh.asset.meta 95B
Escalator.meta 90B
Evacuation.unity.meta 90B
Props
Escalator.fbx.meta 3KB
Materials
Room.mat 621B
Escalator.mat 644B
Escalator.mat.meta 95B
Goal.mat.meta 95B
Wall.mat.meta 95B
Wall.mat 639B
Room.mat.meta 95B
Goal.mat 874B
Room.fbx 20KB
Escalator.fbx 33KB
Room.fbx.meta 2KB
Materials.meta 90B
Props.meta 90B
Scenes.meta 90B
Characters
Robot (Evacuation).prefab 41KB
Dude
WalkForward.fbx 2.41MB
WalkForward.fbx.meta 54KB
Dude.fbx 965KB
Idles.fbx.meta 54KB
Dude.fbx.meta 44KB
Idles.fbx 2.9MB
Robot (Escalator).prefab 41KB
Robot (Evacuation).prefab.meta 95B
Robot Kyle.meta 90B
Dude.meta 90B
Walker.controller.meta 95B
Robot (Escalator).prefab.meta 95B
Walker.controller 3KB
Robot Kyle
Textures.meta 90B
Materials
Robot_Color.mat 904B
Robot_Color.mat.meta 95B
Model
Robot Kyle.fbx.meta 37KB
Robot Kyle.fbx 323KB
Model.meta 90B
Textures
Robot_Normal.tga.meta 709B
Robot_Normal.tga 12MB
Robot_Color.tga 12MB
Robot_Color.tga.meta 710B
Materials.meta 90B
Scripts
EvacuationAI.js 816B
EscalatorEntrance.js.meta 178B
EscalatorEntrance.js 836B
EscalatorGenerator.js 557B
CameraControl.js.meta 178B
EscalatorAI.js.meta 178B
EscalatorGenerator.js.meta 178B
EvacuationAI.js.meta 178B
ExpEase.js 874B
ExpEase.js.meta 178B
CameraControl.js 1KB
EscalatorAI.js 1KB
.gitignore 81B
共 87 条
- 1
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9156
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- pta题库答案c语言之排序4统计工龄.zip
- pta题库答案c语言之树结构7堆中的路径.zip
- pta题库答案c语言之树结构3TreeTraversalsAgain.zip
- pta题库答案c语言之树结构2ListLeaves.zip
- pta题库答案c语言之树结构1树的同构.zip
- 基于C++实现民航飞行与地图简易管理系统可执行程序+说明+详细注释.zip
- pta题库答案c语言之复杂度1最大子列和问题.zip
- 三维装箱问题(Three-Dimensional Bin Packing Problem,3D-BPP)是一个经典的组合优化问题
- 以下是一些关于Linux线程同步的基本概念和方法.txt
- 以下是一个简化的示例,它使用pygame库来模拟烟花动画的框架.txt
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功