Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions NetcodeSamples/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# see http://editorconfig.org/ for docs on this file

root = true

[*]
# help with sharing files across os's (i.e. network share or through local vm)
#end_of_line = lf
#charset temporarily disabled due to bug in VS2017 changing to UTF-8 with BOM (https://favro.com/card/c564ede4ed3337f7b17986b6/Uni-17877)
#charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

# formattable file extensions (keep in sync with format.ini from unity-meta repo)
#
# Note: We need to split the formattable files configs into shorter duplicate entries (logically grouped)
# due to known issue in VS editorconfig extension where there is a limit of 51 characters (empirically determined).
# see: https://github.com/editorconfig/editorconfig-visualstudio/issues/21
#
## uncrustify
[*.{c,h,cpp,hpp,m,mm,cc,cs}]
indent_style = space
indent_size = 4

## generic formatter (shaders)
[*.{cg,cginc,glslinc,hlsl,shader,y,ypp,yy}]
indent_style = space
indent_size = 4

## generic formatter (misc)
[*.{asm,s,S,pch,pchmm,java,sh,uss}]
indent_style = space
indent_size = 4

## perltidy
[*.{pl,pm,t,it}]
indent_style = space
indent_size = 4

## unity special
[*.{bindings,mem.xml}]
indent_style = space
indent_size = 4

# other filetypes we want to overwrite default configuration to preserve the standard
[{Makefile,makefile}]
# TAB characters are part of the Makefile format
indent_style = tab

[*.{md,markdown}]
# trailing whitespace is significant in markdown (bad choice, bad!)
trim_trailing_whitespace = false

# keep these and the VS stuff below in sync with .hgeol's CRLF extensions
[*.{vcproj,bat,cmd,xaml,tt,t4,ttinclude}]
end_of_line = crlf

# this VS-specific stuff is based on experiments to see how VS will modify a file after it has been manually edited.
# the settings are meant to closely match what VS does to minimize unnecessary diffs. this duplicates some settings in *
# but let's be explicit here to be safe (in case someone wants to copy-paste this out to another .editorconfig).
[*.{vcxproj,vcxproj.filters,csproj,props,targets}]
indent_style = space
indent_size = 2
end_of_line = crlf
charset = utf-8-bom
trim_trailing_whitespace = true
insert_final_newline = false
[*.{sln,sln.template}]
indent_style = tab
indent_size = 4
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 0 additions & 51 deletions NetcodeSamples/Assets/RenderGraphAutoAdoption.cs

This file was deleted.

11 changes: 0 additions & 11 deletions NetcodeSamples/Assets/RenderGraphAutoAdoption.cs.meta

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ public struct ParticleEmitterComponentData : IComponentData

public int active;

[System.NonSerialized]
public Entity particlePrefab;
}
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,12 @@ protected void StartIpPortClientServer()

async Task SetHudSessionName()
{
var frontendHud = FindFirstObjectByType<FrontendHUD>();
var frontendHud = FindAnyObjectByType<FrontendHUD>();
// HUD scene might not be loaded yet so we'll need to poll for it
while (frontendHud == null)
{
await Task.Delay(100);
frontendHud = FindFirstObjectByType<FrontendHUD>();
frontendHud = FindAnyObjectByType<FrontendHUD>();
}
frontendHud.LobbyName.text = m_Session.Id;
}
Expand All @@ -220,7 +220,7 @@ void OnSessionMigrated()
if (m_Session.IsHost)
{
// Connect the server migration stats HUD
var statsText = FindFirstObjectByType<HostMigrationHUD>().StatsText;
var statsText = FindAnyObjectByType<HostMigrationHUD>().StatsText;
ClientServerBootstrap.ServerWorld.GetExistingSystemManaged<ServerHostMigrationHUDSystem>().StatsText = statsText;

// Disable the client status HUD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void Start()

// We must always have an event system (DOTS-7177), but some scenes will already have one,
// so we only enable ours if we can't find someone else's.
if (FindFirstObjectByType<UnityEngine.EventSystems.EventSystem>() == null)
if (FindAnyObjectByType<UnityEngine.EventSystems.EventSystem>() == null)
m_EventSystem.gameObject.SetActive(true);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void Start()
if (ClientServerBootstrap.RequestedPlayType != ClientServerBootstrap.PlayType.ClientAndServer)
Debug.LogError($"[HostMigration] Creating client/server worlds is not allowed if playmode is set to {ClientServerBootstrap.RequestedPlayType}");
m_MigrationDataBlob = new NativeList<byte>(InitialDataSize, Allocator.Persistent);
m_HostMigrationFrontend = FindFirstObjectByType<HostMigrationFrontend>();
m_HostMigrationFrontend = FindAnyObjectByType<HostMigrationFrontend>();
DontDestroyOnLoad(this);
}

Expand All @@ -119,7 +119,7 @@ internal void OnSceneLoaded(Scene scene, LoadSceneMode mode)
if (scene.name == Frontend.SceneName)
{
Debug.Log("[HostMigration] Re-entering frontend scene, leaving lobby");
m_HostMigrationFrontend = FindFirstObjectByType<HostMigrationFrontend>();
m_HostMigrationFrontend = FindAnyObjectByType<HostMigrationFrontend>();
StopHeartbeat();
LeaveLobby();
m_LastUpdateTime = 0;
Expand All @@ -130,10 +130,10 @@ internal void OnSceneLoaded(Scene scene, LoadSceneMode mode)
void OnKickedFromLobby()
{
Debug.Log("[HostMigration] Left lobby");
if (FindFirstObjectByType<HostMigrationFrontend>() == null)
if (FindAnyObjectByType<HostMigrationFrontend>() == null)
{
Debug.Log($"[HostMigration] Re-entering frontend scene as we've left the lobby now");
var frontendHud = FindFirstObjectByType<FrontendHUD>();
var frontendHud = FindAnyObjectByType<FrontendHUD>();
frontendHud?.ReturnToFrontend();
}
}
Expand Down Expand Up @@ -376,7 +376,7 @@ async Task CheckHostMigration(ILobbyChanges changes)
ClientServerBootstrap.ClientWorld.EntityManager.DestroyEntity(clientRelayEntity); // cleanup as this is no longer needed

// Connect the server migration stats HUD
var statsText = FindFirstObjectByType<HostMigrationHUD>().StatsText;
var statsText = FindAnyObjectByType<HostMigrationHUD>().StatsText;
ClientServerBootstrap.ServerWorld.GetExistingSystemManaged<ServerHostMigrationHUDSystem>().StatsText = statsText;

// Disable the client status HUD
Expand All @@ -403,7 +403,7 @@ async Task CheckHostMigration(ILobbyChanges changes)
HostMigrationHUD.SetWaitForRelayConnection(new WaitForRelayConnection() { WaitForJoinCode = true, OldJoinCode = RelayJoinCode, IsHostMigration = true, StartTime = Time.realtimeSinceStartup});

// Connect the migration stats HUD
var statsText = FindFirstObjectByType<HostMigrationHUD>().StatsText;
var statsText = FindAnyObjectByType<HostMigrationHUD>().StatsText;
var clientMigrationSystem = ClientServerBootstrap.ClientWorld.GetExistingSystemManaged<ClientHostMigrationHUDSystem>();
clientMigrationSystem.StatsText = statsText;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public override void Start()

protected override void OnStart()
{
hostMigrationController = FindFirstObjectByType<HostMigrationController>();
hostMigrationController = FindAnyObjectByType<HostMigrationController>();
if (hostMigrationController == null)
hostMigrationController = Instantiate(hostMigrationControllerPrefab).GetComponent<HostMigrationController>();
SceneManager.sceneLoaded += hostMigrationController.OnSceneLoaded;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Unity.Burst;
using Unity.Burst;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Entities;
Expand Down Expand Up @@ -35,7 +35,7 @@ protected override void OnCreate()
protected override void OnUpdate()
{
if (m_ConnectionUI == null)
m_ConnectionUI = GameObject.FindFirstObjectByType<ConnectionUI>();
m_ConnectionUI = GameObject.FindAnyObjectByType<ConnectionUI>();

var buffer = m_CommandBufferSystem.CreateCommandBuffer();
foreach (var (_, entity) in SystemAPI.Query<RefRO<NetworkStreamConnection>>().WithEntityAccess().WithNone<ConnectionState>())
Expand Down
Loading