浏览代码

Symbols can be clicked on repeatedly now, so if someone mashes they will lose points as expected. I'm also resolving a timing issue that I missed that happened with a single player, where they'd start the game immediately on connection (since all players were connected) but before the SymbolContainer could call Start to subscribe for the game start message.

/main/staging/ngo_minigame_cleanup
nathaniel.buck@unity3d.com 3 年前
当前提交
be6ccfbe
共有 4 个文件被更改,包括 8 次插入5 次删除
  1. 1
      Assets/Prefabs/InGame/SymbolContainer.prefab
  2. 2
      Assets/Prefabs/InGame/SymbolObject.prefab
  3. 1
      Assets/Scripts/Game/InGame/PlayerCursor.cs
  4. 9
      Assets/Scripts/Game/InGame/SymbolContainer.cs

1
Assets/Prefabs/InGame/SymbolContainer.prefab


m_Script: {fileID: 11500000, guid: 73a6c5df5c3139e448d76f8918fece73, type: 3}
m_Name:
m_EditorClassIdentifier:
m_rb: {fileID: 6367926983050135602}

2
Assets/Prefabs/InGame/SymbolObject.prefab


m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 2, y: 2, z: 0.2}
m_Size: {x: 1.75, y: 1.75, z: 0.2}
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &-8192876538761676823
MonoBehaviour:

1
Assets/Scripts/Game/InGame/PlayerCursor.cs


if (m_currentlyCollidingSymbols.Count > 0)
{
SymbolObject symbol = m_currentlyCollidingSymbols[0];
m_currentlyCollidingSymbols.RemoveAt(0);
Locator.Get.InGameInputHandler.OnPlayerInput(id, symbol);
}
OnInputVisuals_ClientRpc();

9
Assets/Scripts/Game/InGame/SymbolContainer.cs


[RequireComponent(typeof(Rigidbody))]
public class SymbolContainer : NetworkBehaviour, IReceiveMessages
{
private Rigidbody m_rb;
[SerializeField] private Rigidbody m_rb = default;
private bool m_isConnected = false;
private bool m_hasGameStarted = false;
private void OnGameStarted()

BeginMotion();
}
public void Awake() // If there's just one player, Start would occur after the GameBeginning message is sent, so use Awake/OnEnable instead.
{
Locator.Get.Messenger.Subscribe(this);
}
public void Start()
{
if (!IsHost)

m_rb = this.GetComponent<Rigidbody>();
Locator.Get.Messenger.Subscribe(this);
GetComponent<NetworkObject>().Spawn();
}

正在加载...
取消
保存