浏览代码
Adding logic for correctly disconnecting all players when the game ends, with some esoteric fixes (setting IsLocalSpace for the SymbolObject transforms so the client can interpolate them correctly, ensuring clients are disconnected before the host).
/main/staging/ngo_minigame_structure
Adding logic for correctly disconnecting all players when the game ends, with some esoteric fixes (setting IsLocalSpace for the SymbolObject transforms so the client can interpolate them correctly, ensuring clients are disconnected before the host).
/main/staging/ngo_minigame_structure
nathaniel.buck@unity3d.com
3 年前
当前提交
2e0ba992
共有 8 个文件被更改,包括 181 次插入 和 25 次删除
-
61Assets/Prefabs/InGame/InGameLogic.prefab
-
4Assets/Prefabs/InGame/SymbolObject.prefab
-
71Assets/Scripts/Game/InGame/InGameRunner.cs
-
1Assets/Scripts/Game/InGame/PlayerCursor.cs
-
19Assets/Scripts/Game/InGame/SetupInGame.cs
-
5Assets/Scripts/Game/InGame/SymbolContainer.cs
-
34Assets/Scripts/Game/InGame/SymbolKillVolume.cs
-
11Assets/Scripts/Game/InGame/SymbolKillVolume.cs.meta
|
|||
using System; |
|||
using UnityEngine; |
|||
|
|||
namespace LobbyRelaySample.inGame |
|||
{ |
|||
/// <summary>
|
|||
/// Used by the host to deactivate symbol objects once they're off-screen.
|
|||
/// </summary>
|
|||
[RequireComponent(typeof(Collider))] |
|||
public class SymbolKillVolume : MonoBehaviour |
|||
{ |
|||
private bool m_isInitialized = false; |
|||
private Action m_onSymbolCollided; |
|||
|
|||
public void Initialize(Action onSymbolCollided) |
|||
{ |
|||
m_onSymbolCollided = onSymbolCollided; |
|||
m_isInitialized = true; |
|||
} |
|||
|
|||
public void OnTriggerEnter(Collider other) |
|||
{ |
|||
if (!m_isInitialized) |
|||
return; |
|||
|
|||
SymbolObject symbolObj = other.GetComponent<SymbolObject>(); |
|||
if (symbolObj != null) |
|||
{ |
|||
symbolObj.Destroy_ServerRpc(); |
|||
m_onSymbolCollided?.Invoke(); |
|||
} |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: cdfa9a141b4e8ee4a8d88982568d94c8 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue