0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Photon FusionのDespawnedメソッドがoverrideできない?

Posted at

Photon FusionのDespawnedメソッドの公式ドキュメントのサンプルが間違っていて、そのままコピーするとoverrideできません。

IDespawnedでDespawned自体は実装されているのですが、実際には引数ありのDespawanedなのでサンプルそのままだとoverrideできません。以下の通り引数を追加すれば正常に動作します。

public class Example : NetworkBehaviour
{
    public override void Despawned(NetworkRunner runner, bool hasState)
    {
        // Use this instead of Destroy for NetworkObjects
    }
}

よくよく考えるとDespawnedするタイミングでrunnerが必要な場合などあるでしょうし、便利にした結果、ドキュメントの更新まで追いついていないのかなと思いました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?