日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

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

發(fā)布時間:2024/3/13 编程问答 45 豆豆
生活随笔 收集整理的這篇文章主要介紹了 [Unity][Crowd]学习人群模拟资源分享以及相关的问题 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

?

人群行為模擬--超市模擬

內(nèi)容來源參考資料3,僅供學(xué)習(xí)。

項目描述:藍(lán)色實體表示行人的數(shù)量,紅色實體表示扒手小偷的數(shù)量,綠色表示 超級英雄的數(shù)量。

藍(lán)色行人在逛商場,紅色扒手對藍(lán)色行人進(jìn)行偷竊,紅色扒手有可能 對藍(lán)色行人 進(jìn)行攻擊。

綠色超級英雄(見義勇為)會從 藍(lán)色行人 中 誕生,當(dāng)?綠色超級英雄(見義勇為)發(fā)現(xiàn) 紅色扒手小偷的時候,就會從藍(lán)色行人 變成綠色超級英雄,并且與紅色扒手小偷進(jìn)行戰(zhàn)斗。

藍(lán)色行人產(chǎn)生恐慌,就變成 黑色,逃離商場。

?


由于項目工程的版本落后,使用Unity 2018.2.18f1 (64-bit)打開,出現(xiàn)的問題。

?

打開場景mall之后出現(xiàn)的問題

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.

?

?

總結(jié)

以上是生活随笔為你收集整理的[Unity][Crowd]学习人群模拟资源分享以及相关的问题的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。