我有一個Time.timeScale
等於0,使整個遊戲暫停。有沒有辦法讓遊戲對象不受Time.time
比例的影響,所以在整個遊戲仍然暫停的情況下,空遊戲仍然有效?Bypass Time.timeScale
2
A
回答
-1
Time.realtimeSinceStartup
不受Time.timeScale
所以基本上你可以通過做
float lastRealTime = 0f;
float deltaRealTime = 0f;
public void Update()
{
deltaRealTime = Time.realtimeSinceStartup - lastRealTime;
lastRealTime = Time.realtimeSinceStartup;
}
http://docs.unity3d.com/ScriptReference/Time-realtimeSinceStartup.html
1
沒有創建自己的增量,也沒有辦法。 FixedUpdate
functions will not be called when timeScale is set to zero,因此您無法將比例設置爲零,並且仍然有一個對象FixedUpdate
處於運動狀態,因爲您需要FixedUpdate
來更新其變換。
你必須做些事情暫停其他對象而不暫停遊戲,看看this post。
相關問題
- 1. Handle Time.timeScale onChange事件
- 2. Bypass Incapsula JStest
- 3. NodeJS - Express bypass basicAuth
- 4. Spring Roo - Bypass Hibernate
- 5. Bypass「mass assignement」laravel
- 6. iPhone touchmove bypass
- 7. Android Bypass Captive Portal
- 8. Bypass Ajax Autoscroll
- 9. Bypass/Defer AngularJS $ http.get Promise
- 10. 暫停Unity遊戲沒有「Time.timeScale = 0」
- 11. 當Time.timeScale = 0時播放粒子系統?
- 12. Bypass @Cacheable for(un)authenticated requests
- 13. Bypass「Array is too big」python error
- 14. Bypass for can not re-declare function
- 15. 掛毯5 ByPass驗證
- 16. Bypass anti ddos PhantomJs and Selenium
- 17. Internet Explorer的Bypass Credential對話框
- 18. Bypass php is_numeric()函數是可能的嗎?
- 19. Bypass Code-Signing for iOS Test Dev - XCode Version 6.0.1
- 20. Bypass瘋狂的公司安全系統
- 21. 在Android Studio中使用Bypass降價庫
- 22. 終端上的chrome headless bypass認證
- 23. WebBrowser控件中的Bypass Find對話框
- 24. Bypass融合表圖層緩存
- 25. Bypass Rack ::緩存來自CDN的請求
- 26. Ruby中的Escape/Bypass 404錯誤(Instagram API)
- 27. NSView子類中的ByPass init(編碼器)
- 28. Intuit API Bypass授權頁面/登錄
- 29. Unity中的Time.timeScale C#不能正常工作
- 30. Bypass WooCommerce我的帳戶登錄自定義登錄
到目前爲止你有什麼代碼? – user3071284