根据已经创建好的僵尸,又复制多十几只出来,运行游戏发现太卡了
Characters array resized. For best performance increase the size of the Start Character Count variable within the Deterministic Object Manager to a value of at least 18
UnityEngine.Debug:LogWarning(Object)
Opsive.UltimateCharacterController.Game.DeterministicObjectManager:RegisterCharacterInternal(UltimateCharacterLocomotion) (at Assets/Opsive/UltimateCharacterController/Scripts/Game/DeterministicObjectManager.cs:295)
Opsive.UltimateCharacterController.Game.DeterministicObjectManager:RegisterCharacter(UltimateCharacterLocomotion) (at Assets/Opsive/UltimateCharacterController/Scripts/Game/DeterministicObjectManager.cs:283)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion:OnEnable() (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:561)
没有报错,只有黄色的提示,我按照提示,将Deterministic Object Manager脚本中的Start Character Count 设置为18了,但是运行游戏还是好卡,又多次将这个值设置为50、100、甚至1000,运行游戏还是好卡,请问老师应该怎么优化性能,让他不卡呢,想设置多点僵尸,打起来才好玩。
同学你好,如果人物很多,可以考虑使用对象池,如果种类不同,那么可以在游戏进入前全部加载,生成,需要使用到的时候再去显示,不需要的时候去隐藏。另外,场景上可以优化,参考一下这篇文章:
https://www.jianshu.com/p/584513f5f7cf