Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在开发一个游戏,几分钟后我有很多事情会发生变化,所以我创建了一个新游戏按钮,我使用 Application.Restart() 清理所有内容并获得一个新的新游戏,但问题是是这退出游戏并开始新的游戏。我想要做的是重新开始游戏,但没有玩家注意到游戏退出。我该怎么做呢?
最好的问候,乔奥。
您应该在主游戏控制器类上实现 Start()、Stop() 和 Restart() 方法。Restart() 方法应该重置所有变量、状态、玩家、分数等的值,并重置游戏板/环境并将游戏重置为原始状态。不幸的是,Application.Restart() 总是很引人注目。