欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

[Unity][Crowd]学习人群模拟资源分享以及相关的问题

发布时间:2024/3/13 51 豆豆
生活随笔 收集整理的这篇文章主要介绍了 [Unity][Crowd]学习人群模拟资源分享以及相关的问题 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

 

人群行为模拟--超市模拟

内容来源参考资料3,仅供学习。

项目描述:蓝色实体表示行人的数量,红色实体表示扒手小偷的数量,绿色表示 超级英雄的数量。

蓝色行人在逛商场,红色扒手对蓝色行人进行偷窃,红色扒手有可能 对蓝色行人 进行攻击。

绿色超级英雄(见义勇为)会从 蓝色行人 中 诞生,当 绿色超级英雄(见义勇为)发现 红色扒手小偷的时候,就会从蓝色行人 变成绿色超级英雄,并且与红色扒手小偷进行战斗。

蓝色行人产生恐慌,就变成 黑色,逃离商场。

 


由于项目工程的版本落后,使用Unity 2018.2.18f1 (64-bit)打开,出现的问题。

 

打开场景mall之后出现的问题

Assets/Plugins/BehaviourMachine/Sample Scenes/7 - Games/Roll-a-Ball/Move.cs(16,23): error CS1061: Type `UnityEngine.Component' does not contain a definition for `AddForce' and no extension method `AddForce' of type `UnityEngine.Component' could be found. Are you missing an assembly reference?
 

...rigidbody.AddForce(movement * speed * Time.deltaTime);//error//写为GetComponent<Rigidbody>().AddForce(movement * speed * Time.deltaTime);//或者可以写为this.GetComponent<Rigidbody>().AddForce(movement * speed * Time.deltaTime); ...

 

Assets/Plugins/BehaviourMachine/Sample Scenes/7 - Games/Roll-a-Ball/ProcessTrigger.cs(24,23): error CS1061: Type `UnityEngine.Component' does not contain a definition for `Play' and no extension method `Play' of type `UnityEngine.Component' could be found. Are you missing `UnityEngine.Playables' using directive?

 

...audio.Play();//改为GetComponent<AudioSource>().Play();//或者改为this.GetComponent<AudioSource>().Play(); ...

 


 

 


项目文件参考资料1,下载地址 参考资料2

 

 

参考资料:

1.https://bitbucket.org/fdhalluin/epita_pfee_2014_crowdbehavior/src/master/

2.https://bitbucket.org/fdhalluin/epita_pfee_2014_crowdbehavior/downloads/

3.Crowd Behavior - Mall Simulation

4.

 

 

总结

以上是生活随笔为你收集整理的[Unity][Crowd]学习人群模拟资源分享以及相关的问题的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。