浏览代码

merge changes from sfdev

/main
eheimburg 4 年前
当前提交
dcf0c6dc
共有 8 个文件被更改,包括 252 次插入260 次删除
  1. 8
      Assets/BossRoom/Prefabs/Player.prefab
  2. 486
      Assets/BossRoom/Scenes/DungeonTest.unity
  3. 2
      Assets/BossRoom/Scenes/DungeonTest/NavMesh.asset
  4. 4
      Assets/BossRoom/Scenes/MainMenu.unity
  5. 2
      Assets/BossRoom/Scripts/Client/ClientCharacterVisualization.cs
  6. 5
      Assets/BossRoom/Scripts/Server/Game/State/ServerBossRoomState.cs
  7. 3
      Assets/BossRoom/Scripts/Server/ServerCharacterMovement.cs
  8. 2
      Assets/BossRoom/Scripts/Shared/NetworkCharacterState.cs

8
Assets/BossRoom/Prefabs/Player.prefab


m_Script: {fileID: 11500000, guid: edb78c1621dad5149bb47b96120d3fbf, type: 3}
m_Name:
m_EditorClassIdentifier:
NetworkPosition:
InternalValue: {x: 0, y: 0, z: 0}
NetworkRotationY:
InternalValue: 0
NetworkMovementSpeed:
InternalValue: 0
--- !u!114 &4600110157238723776
MonoBehaviour:
m_ObjectHideFlags: 0

m_Script: {fileID: 11500000, guid: fdad0914904cc1e47933ecd7a58514ac, type: 3}
m_Name:
m_EditorClassIdentifier:
movementSpeed: 4
m_MovementSpeed: 4
--- !u!54 &4470766618279719912
Rigidbody:
m_ObjectHideFlags: 0

486
Assets/BossRoom/Scenes/DungeonTest.unity
文件差异内容过多而无法显示
查看文件

2
Assets/BossRoom/Scenes/DungeonTest/NavMesh.asset
文件差异内容过多而无法显示
查看文件

4
Assets/BossRoom/Scenes/MainMenu.unity


CreatePlayerPrefab: 0
ReceiveTickrate: 0
MaxReceiveEventsPerTickRate: 1000
EventTickrate: 0
EventTickrate: 100
ClientConnectionBufferTimeout: 10
ConnectionApproval: 1
ConnectionData:

EnableNetworkedVar: 0
EnableNetworkedVar: 1
EnsureNetworkedVarLengthSafety: 0
EnableSceneManagement: 1
ForceSamePrefabs: 0

2
Assets/BossRoom/Scripts/Client/ClientCharacterVisualization.cs


if (m_ClientVisualsAnimator)
{
// set Animator variables here
m_ClientVisualsAnimator.SetFloat("Speed", networkCharacterState.NetworkMovementSpeed.Value);
m_ClientVisualsAnimator.SetFloat("Speed", m_NetworkCharacterState.NetworkMovementSpeed.Value);
}
}

5
Assets/BossRoom/Scripts/Server/Game/State/ServerBossRoomState.cs


// Instead, we wait a bit for MLAPI to get its state organized, because we can't safely create entities in OnClientConnected().
// (Note: on further explortation, I think this is due to some sort of scene-loading synchronization: the new client is briefly
// "in" the lobby screen, but has already told the server it's in the game scene. Or something similar.)
//
// Note: this workaround doesn't help us when the client connects during the host's scene-load (i.e. when the Host is in char-gen
// screen and gets a new connection) and the ServerBossRoomState doesn't exist yet. That's an unrelated problem, and not an
// MLAPI issue! ... But it generates the same error message ("Cannot find pending soft sync object. Is the projects the same?")
// so wanted to mention it.
StartCoroutine(CoroSpawnPlayer(clientId));
}

3
Assets/BossRoom/Scripts/Server/ServerCharacterMovement.cs


// Recalculate navigation path only on target change.
m_NavMeshAgent.CalculatePath(position, m_DesiredMovementPath);
}
private void Awake()

// Send new position values to the client
m_NetworkCharacterState.NetworkPosition.Value = transform.position;
m_NetworkCharacterState.NetworkRotationY.Value = transform.rotation.eulerAngles.y;
networkCharacterState.NetworkMovementSpeed.Value = movementState == MovementState.Idle ? 0 : movementSpeed;
m_NetworkCharacterState.NetworkMovementSpeed.Value = m_MovementState == MovementState.Idle ? 0 : m_MovementSpeed;
}
private void Movement()

2
Assets/BossRoom/Scripts/Shared/NetworkCharacterState.cs


/// The networked rotation of this Character. This reflects the authorative rotation on the server.
/// </summary>
public NetworkedVarFloat NetworkRotationY { get; } = new NetworkedVarFloat();
public NetworkedVarFloat NetworkMovementSpeed;
public NetworkedVarFloat NetworkMovementSpeed { get; } = new NetworkedVarFloat();
/// <summary>
/// Gets invoked when inputs are received from the client which own this networked character.

正在加载...
取消
保存