Netcode OnIsServerAuthoritative() 2024-05-04 10 笔记 ```csharp public bool IsServerAuthoritative() { return OnIsServerAuthoritative(); } ``` ```csharp protected virtual bool OnIsServerAuthoritative() { return true; } ``` 上面这两段代码来自Netcode的NetworkTransform。 这两段被用在很多位置,比如玩家位置更新前的所有权检测。 如果我们的游戏不需要考虑所有权以及玩家作弊的情况那么可以将OnIsServerAuthoritative()的返回值设置为false。 具体实现方法是自己新建一个脚本,比如我的叫ClientNetworkTransform,我们重写虚方法,将返回值设置为false即可。 更加方便快捷。 本文链接: https://shrinken.pw/crash-2024-05-04_71-fml.html