我可以在 Unity C# 中没有 photonView 的情况下在对象之间发送消息吗?
Can I send messages between objects without photonView in Unity C#?
我正在用 unity C# 制作 3D 在线手机游戏。我想让房间等到房间里的每个人都加载场景。我为早加入的人等待 UI,但我找不到明确的方法来判断那些有东西的玩家进入场景而不编写脏代码(例如制作同步计数器对象)。
在 Unity C# 中,我可以在没有 photonView 的情况下在对象之间发送消息吗?
I can't find a clear way to cout the players who have things such as
entered the scene without writing dirty code such as making a
syncronized counter object
从主客户端(PhotonNetwork.IsMasterClient
检查),在新玩家加入时检查加入房间的演员数量(在 IInRoomCallbacks.OnPlayerEnteredRoom
回调中,阅读回调 here). If the number matches the one you expect, load the level from the Master Client using the Photon method (PhotonNetwork.LoadLevel
, see reference API here)和不是默认的 Unity 方法。其他加入玩家的所有客户端将自动跟随。
Can I send messages between objects without photonView in Unity C#?
是的。通过 PhotonNetwork.RaiseEvent
使用自定义事件。阅读更多相关信息 here。
我正在用 unity C# 制作 3D 在线手机游戏。我想让房间等到房间里的每个人都加载场景。我为早加入的人等待 UI,但我找不到明确的方法来判断那些有东西的玩家进入场景而不编写脏代码(例如制作同步计数器对象)。 在 Unity C# 中,我可以在没有 photonView 的情况下在对象之间发送消息吗?
I can't find a clear way to cout the players who have things such as entered the scene without writing dirty code such as making a syncronized counter object
从主客户端(PhotonNetwork.IsMasterClient
检查),在新玩家加入时检查加入房间的演员数量(在 IInRoomCallbacks.OnPlayerEnteredRoom
回调中,阅读回调 here). If the number matches the one you expect, load the level from the Master Client using the Photon method (PhotonNetwork.LoadLevel
, see reference API here)和不是默认的 Unity 方法。其他加入玩家的所有客户端将自动跟随。
Can I send messages between objects without photonView in Unity C#?
是的。通过 PhotonNetwork.RaiseEvent
使用自定义事件。阅读更多相关信息 here。