Compare commits

...

14 Commits

Author SHA1 Message Date
mischa
1afa0263f8
Merge 564b6f4237 into 04bb95311b 2024-11-03 17:46:41 +08:00
MrGadget
04bb95311b fix(PlayerTest): Added PlayerName labels to prefabs
Some checks failed
Main / Run Unity Tests (push) Has been cancelled
Main / Semantic Release (push) Has been cancelled
Main / Delete Old Workflow Runs (push) Has been cancelled
2024-11-02 18:30:10 -04:00
MrGadget
e9a8e02a40 fix(PlayerCamera): Improved cleanup
- avoids error in editor
2024-11-02 18:29:05 -04:00
MrGadget
bb97db4eaa chore(CI): RunUnityTests - updated unityVersion 2024-11-01 15:05:14 -04:00
MrGadget
e7b3aa77df fix(Extentions): GetLocalPositionAndRotation and SetLocalPositionAndRotation 2024-10-29 17:43:44 -04:00
MrGadget
f61524863e fix: Cleanup after PR #3935 2024-10-29 10:46:43 -04:00
mischa
af133e6110
fix: #2802 NetworkManager uses OnDestroy for shutdown instead of OnApplicationQuit (#3935)
* fix: #2802 NetworkManager uses OnDestroy for shutdown instead of OnApplicationQuit

* imer feedback

---------

Co-authored-by: mischa <info@noobtuts.com>
2024-10-29 15:06:44 +01:00
mischa
a9d280cd4b fix: #3785 NetworkIdentity.OnDestroy verifies spawned[netId] before removing 2024-10-29 10:54:30 +01:00
mischa
c4f803fcf6 fix: #3301 Read/Write HashSet<T> support is now detected by Weaver 2024-10-29 09:47:33 +01:00
mischa
03357f4275 fix: #3876 KcpTransport OnClientError null handling during shutdown 2024-10-29 08:54:19 +01:00
mischa
c80a3c8ea5
fix: #3262 allow running a mirror project from edit prefab mode again (#3924)
Co-authored-by: mischa <info@noobtuts.com>
2024-10-28 23:13:23 +01:00
mischa
68c7d14a16 Benchmark: monsters move with 10% probability to make sure we can detect change detection in NT 2024-10-28 11:16:58 +01:00
JesusLuvsYooh
df7a343d7e
fix: Robot Kyle Optimized (#3934)
4mb png normal map down to 0.4mb jpg
overall RobotKyle folder down from ~7mb to 1.5mb
2024-10-27 09:00:39 -04:00
vis2k
564b6f4237 fix: #2623 NetworkServer.SetClientReady returns if already ready. fixes clients spamming ReadyMessage to force observer rebuilds etc. [imer] 2023-01-29 19:08:32 +09:00
37 changed files with 1048 additions and 214 deletions

View File

@ -16,7 +16,7 @@ jobs:
- 2021.3.45f1 - 2021.3.45f1
- 2022.3.51f1 - 2022.3.51f1
- 2023.2.20f1 - 2023.2.20f1
- 6000.0.24f1 - 6000.0.25f1
steps: steps:
- name: Checkout repository - name: Checkout repository

View File

@ -671,8 +671,25 @@ void OnDestroy()
// if an identity is still in .spawned, remove it too. // if an identity is still in .spawned, remove it too.
// fixes: https://github.com/MirrorNetworking/Mirror/issues/3324 // fixes: https://github.com/MirrorNetworking/Mirror/issues/3324
//
// however, verify that spawned[netId] is this NetworkIdentity
// fixes: https://github.com/MirrorNetworking/Mirror/issues/3785
// - server: netId=42 walks out of and back into AOI range in same frame
// - client frame 1:
// on_destroymsg(42) -> NetworkClient.DestroyObject -> GameObject.Destroy(42) // next frame
// on_spawnmsg(42) -> NetworkClient.SpawnPrefab -> Instantiate(42) -> spawned[42]=new_identity
// - client frame 2:
// Unity destroys the old 42
// NetworkIdentity.OnDestroy removes .spawned[42] which is new_identity not old_identity
// new_identity becomes orphaned
//
// solution: only remove if spawned[netId] is this NetworkIdentity or null
if (NetworkClient.spawned.TryGetValue(netId, out NetworkIdentity entry))
{
if (entry == this || entry == null)
NetworkClient.spawned.Remove(netId); NetworkClient.spawned.Remove(netId);
} }
}
// workaround for cyclid NI<->NB reference causing memory leaks // workaround for cyclid NI<->NB reference causing memory leaks
// after Destroy. [Credits: BigBoxVR/R.S.] // after Destroy. [Credits: BigBoxVR/R.S.]

View File

@ -634,31 +634,6 @@ public void StopClient()
NetworkClient.Disconnect(); NetworkClient.Disconnect();
} }
// called when quitting the application by closing the window / pressing
// stop in the editor. virtual so that inheriting classes'
// OnApplicationQuit() can call base.OnApplicationQuit() too
public virtual void OnApplicationQuit()
{
// stop client first
// (we want to send the quit packet to the server instead of waiting
// for a timeout)
if (NetworkClient.isConnected)
{
StopClient();
//Debug.Log("OnApplicationQuit: stopped client");
}
// stop server after stopping client (for proper host mode stopping)
if (NetworkServer.active)
{
StopServer();
//Debug.Log("OnApplicationQuit: stopped server");
}
// Call ResetStatics to reset statics and singleton
ResetStatics();
}
/// <summary>Set the frame rate for a headless builds. Override to disable or modify.</summary> /// <summary>Set the frame rate for a headless builds. Override to disable or modify.</summary>
// useful for dedicated servers. // useful for dedicated servers.
// useful for headless benchmark clients. // useful for headless benchmark clients.
@ -772,12 +747,41 @@ public static void ResetStatics()
singleton = null; singleton = null;
} }
// virtual so that inheriting classes' OnDestroy() can call base.OnDestroy() too // called when quitting the application by closing the window / pressing
// stop in the editor.
// use OnDestroy instead of OnApplicationQuit:
// fixes: https://github.com/MirrorNetworking/Mirror/issues/2802
public virtual void OnDestroy() public virtual void OnDestroy()
{ {
//Debug.Log("NetworkManager destroyed"); //Debug.Log("NetworkManager destroyed");
// stop client first
// (we want to send the quit packet to the server instead of waiting
// for a timeout)
if (NetworkClient.isConnected)
{
StopClient();
//Debug.Log("OnApplicationQuit: stopped client");
} }
// stop server after stopping client (for proper host mode stopping)
if (NetworkServer.active)
{
StopServer();
//Debug.Log("OnApplicationQuit: stopped server");
}
// Call ResetStatics to reset statics and singleton
ResetStatics();
}
// [Obsolete] in case someone is inheriting it.
// don't use this anymore.
// fixes: https://github.com/MirrorNetworking/Mirror/issues/2802
// DEPRECATED 2024-10-29
[Obsolete("Override OnDestroy instead of OnApplicationQuit.")]
public virtual void OnApplicationQuit() {}
/// <summary>The name of the current network scene.</summary> /// <summary>The name of the current network scene.</summary>
// set by NetworkManager when changing the scene. // set by NetworkManager when changing the scene.
// new clients will automatically load this scene. // new clients will automatically load this scene.

View File

@ -313,8 +313,6 @@ public static List<T> ReadList<T>(this NetworkReader reader)
// structs may have .Set<T> members which weaver needs to be able to // structs may have .Set<T> members which weaver needs to be able to
// fully serialize for NetworkMessages etc. // fully serialize for NetworkMessages etc.
// note that Weaver/Readers/GenerateReader() handles this manually. // note that Weaver/Readers/GenerateReader() handles this manually.
// TODO writer not found. need to adjust weaver first. see tests.
/*
public static HashSet<T> ReadHashSet<T>(this NetworkReader reader) public static HashSet<T> ReadHashSet<T>(this NetworkReader reader)
{ {
// we offset count by '1' to easily support null without writing another byte. // we offset count by '1' to easily support null without writing another byte.
@ -334,7 +332,6 @@ public static HashSet<T> ReadHashSet<T>(this NetworkReader reader)
} }
return result; return result;
} }
*/
public static T[] ReadArray<T>(this NetworkReader reader) public static T[] ReadArray<T>(this NetworkReader reader)
{ {

View File

@ -1266,6 +1266,11 @@ public static void SetClientReady(NetworkConnectionToClient conn)
{ {
// Debug.Log($"SetClientReadyInternal for conn:{conn}"); // Debug.Log($"SetClientReadyInternal for conn:{conn}");
// only if not already ready yet.
// prevents clients spamming ReadyMessage to force observer rebuilds.
// fixes: https://github.com/MirrorNetworking/Mirror/issues/2623
if (conn.isReady) return;
// set ready // set ready
conn.isReady = true; conn.isReady = true;

View File

@ -365,28 +365,25 @@ public static void WriteList<T>(this NetworkWriter writer, List<T> list)
// structs may have .Set<T> members which weaver needs to be able to // structs may have .Set<T> members which weaver needs to be able to
// fully serialize for NetworkMessages etc. // fully serialize for NetworkMessages etc.
// note that Weaver/Writers/GenerateWriter() handles this manually. // note that Weaver/Writers/GenerateWriter() handles this manually.
// TODO writer not found. need to adjust weaver first. see tests. public static void WriteHashSet<T>(this NetworkWriter writer, HashSet<T> hashSet)
// /* {
// public static void WriteHashSet<T>(this NetworkWriter writer, HashSet<T> hashSet) // we offset count by '1' to easily support null without writing another byte.
// { // encoding null as '0' instead of '-1' also allows for better compression
// // we offset count by '1' to easily support null without writing another byte. // (ushort vs. short / varuint vs. varint) etc.
// // encoding null as '0' instead of '-1' also allows for better compression if (hashSet is null)
// // (ushort vs. short / varuint vs. varint) etc. {
// if (hashSet is null) // most sizes are small, write size as VarUInt!
// { Compression.CompressVarUInt(writer, 0u);
// // most sizes are small, write size as VarUInt! //writer.WriteUInt(0);
// Compression.CompressVarUInt(writer, 0u); return;
// //writer.WriteUInt(0); }
// return;
// } // most sizes are small, write size as VarUInt!
// Compression.CompressVarUInt(writer, checked((uint)hashSet.Count) + 1u);
// // most sizes are small, write size as VarUInt! //writer.WriteUInt(checked((uint)hashSet.Count) + 1u);
// Compression.CompressVarUInt(writer, checked((uint)hashSet.Count) + 1u); foreach (T item in hashSet)
// //writer.WriteUInt(checked((uint)hashSet.Count) + 1u); writer.Write(item);
// foreach (T item in hashSet) }
// writer.Write(item);
// }
// */
public static void WriteArray<T>(this NetworkWriter writer, T[] array) public static void WriteArray<T>(this NetworkWriter writer, T[] array)
{ {

View File

@ -114,6 +114,18 @@ public static void SetPositionAndRotation(this Transform transform, Vector3 posi
transform.position = position; transform.position = position;
transform.rotation = rotation; transform.rotation = rotation;
} }
public static void GetLocalPositionAndRotation(this Transform transform, out Vector3 position, out Quaternion rotation)
{
position = transform.localPosition;
rotation = transform.localRotation;
}
public static void SetLocalPositionAndRotation(this Transform transform, Vector3 position, Quaternion rotation)
{
transform.localPosition = position;
transform.localRotation = rotation;
}
#endif #endif
// IPEndPoint address only to pretty string. // IPEndPoint address only to pretty string.

View File

@ -196,8 +196,15 @@ public virtual void ServerLateUpdate() {}
/// <summary>Shut down the transport, both as client and server</summary> /// <summary>Shut down the transport, both as client and server</summary>
public abstract void Shutdown(); public abstract void Shutdown();
/// <summary>Called by Unity when quitting. Inheriting Transports should call base for proper Shutdown.</summary> // [Obsolete] in case someone is inheriting it.
public virtual void OnApplicationQuit() // don't use this anymore.
// fixes: https://github.com/MirrorNetworking/Mirror/issues/2802
// DEPRECATED 2024-10-29
[Obsolete("Override OnDestroy instead of OnApplicationQuit.")]
public virtual void OnApplicationQuit() {}
// fixes: https://github.com/MirrorNetworking/Mirror/issues/2802
public virtual void OnDestroy()
{ {
// stop transport (e.g. to shut down threads) // stop transport (e.g. to shut down threads)
// (when pressing Stop in the Editor, Unity keeps threads alive // (when pressing Stop in the Editor, Unity keeps threads alive

View File

@ -55,19 +55,28 @@ public static void OnPostProcessScene()
else else
{ {
// there are two cases where sceneId == 0: // there are two cases where sceneId == 0:
// * if we have a prefab open in the prefab scene // if we have a prefab open in the prefab scene
// * if an unopened scene needs resaving
// show a proper error message in both cases so the user
// knows what to do.
string path = identity.gameObject.scene.path; string path = identity.gameObject.scene.path;
if (string.IsNullOrWhiteSpace(path)) if (string.IsNullOrWhiteSpace(path))
{
// pressing play while in prefab edit mode used to freeze/crash Unity 2019.
// this seems fine now so we don't need to stop the editor anymore.
#if UNITY_2020_3_OR_NEWER
Debug.LogWarning($"{identity.name} was open in Prefab Edit Mode while launching with Mirror. If this causes issues, please let us know.");
#else
Debug.LogError($"{identity.name} is currently open in Prefab Edit Mode. Please open the actual scene before launching Mirror."); Debug.LogError($"{identity.name} is currently open in Prefab Edit Mode. Please open the actual scene before launching Mirror.");
else
Debug.LogError($"Scene {path} needs to be opened and resaved, because the scene object {identity.name} has no valid sceneId yet.");
// either way we shouldn't continue. nothing good will
// happen when trying to launch with invalid sceneIds.
EditorApplication.isPlaying = false; EditorApplication.isPlaying = false;
#endif
}
// if an unopened scene needs resaving
else
{
// nothing good will happen when trying to launch with invalid sceneIds.
// show an error and stop playing immediately.
Debug.LogError($"Scene {path} needs to be opened and resaved, because the scene object {identity.name} has no valid sceneId yet.");
EditorApplication.isPlaying = false;
}
} }
} }
} }

View File

@ -125,6 +125,13 @@ MethodReference GenerateReader(TypeReference variableReference, ref bool Weaving
return GenerateReadCollection(variableReference, elementType, nameof(NetworkReaderExtensions.ReadList), ref WeavingFailed); return GenerateReadCollection(variableReference, elementType, nameof(NetworkReaderExtensions.ReadList), ref WeavingFailed);
} }
else if (variableDefinition.Is(typeof(HashSet<>)))
{
GenericInstanceType genericInstance = (GenericInstanceType)variableReference;
TypeReference elementType = genericInstance.GenericArguments[0];
return GenerateReadCollection(variableReference, elementType, nameof(NetworkReaderExtensions.ReadHashSet), ref WeavingFailed);
}
// handle both NetworkBehaviour and inheritors. // handle both NetworkBehaviour and inheritors.
// fixes: https://github.com/MirrorNetworking/Mirror/issues/2939 // fixes: https://github.com/MirrorNetworking/Mirror/issues/2939
else if (variableReference.IsDerivedFrom<NetworkBehaviour>() || variableReference.Is<NetworkBehaviour>()) else if (variableReference.IsDerivedFrom<NetworkBehaviour>() || variableReference.Is<NetworkBehaviour>())

View File

@ -126,6 +126,13 @@ MethodReference GenerateWriter(TypeReference variableReference, ref bool Weaving
return GenerateCollectionWriter(variableReference, elementType, nameof(NetworkWriterExtensions.WriteList), ref WeavingFailed); return GenerateCollectionWriter(variableReference, elementType, nameof(NetworkWriterExtensions.WriteList), ref WeavingFailed);
} }
if (variableReference.Is(typeof(HashSet<>)))
{
GenericInstanceType genericInstance = (GenericInstanceType)variableReference;
TypeReference elementType = genericInstance.GenericArguments[0];
return GenerateCollectionWriter(variableReference, elementType, nameof(NetworkWriterExtensions.WriteHashSet), ref WeavingFailed);
}
// handle both NetworkBehaviour and inheritors. // handle both NetworkBehaviour and inheritors.
// fixes: https://github.com/MirrorNetworking/Mirror/issues/2939 // fixes: https://github.com/MirrorNetworking/Mirror/issues/2939

View File

@ -62,15 +62,6 @@ public override void LateUpdate()
base.LateUpdate(); base.LateUpdate();
} }
/// <summary>
/// Runs on both Server and Client
/// </summary>
public override void OnDestroy()
{
base.OnDestroy();
//UnityEngine.Debug.Log("OnDestroy");
}
#endregion #endregion
#region Start & Stop #region Start & Stop
@ -87,10 +78,10 @@ public override void ConfigureHeadlessFrameRate()
/// <summary> /// <summary>
/// called when quitting the application by closing the window / pressing stop in the editor /// called when quitting the application by closing the window / pressing stop in the editor
/// </summary> /// </summary>
public override void OnApplicationQuit() public override void OnDestroy()
{ {
base.OnApplicationQuit(); base.OnDestroy();
//UnityEngine.Debug.Log("OnApplicationQuit"); //UnityEngine.Debug.Log("OnDestroy");
} }
#endregion #endregion

View File

@ -148,5 +148,5 @@ MonoBehaviour:
syncMode: 0 syncMode: 0
syncInterval: 0.1 syncInterval: 0.1
speed: 1 speed: 1
movementProbability: 0.5 movementProbability: 0.1
movementDistance: 20 movementDistance: 20

View File

@ -5,7 +5,13 @@ namespace Mirror.Examples.Benchmark
public class MonsterMovement : NetworkBehaviour public class MonsterMovement : NetworkBehaviour
{ {
public float speed = 1; public float speed = 1;
public float movementProbability = 0.5f;
// movement probability:
// 0.5 is too high, monsters are moving almost all the time.
// only-sync-on-change shows no difference with 0.5 at all.
// in other words: broken change detection would be too easy to miss!
[Header("Note: use 0.1 to test change detection, 0.5 is too high!")]
public float movementProbability = 0.1f;
public float movementDistance = 20; public float movementDistance = 20;
bool moving; bool moving;

View File

@ -1,5 +1,111 @@
%YAML 1.1 %YAML 1.1
%TAG !u! tag:unity3d.com,2011: %TAG !u! tag:unity3d.com,2011:
--- !u!1 &2505838817581327622
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8070823805368028938}
- component: {fileID: 9066655185906928051}
- component: {fileID: 4760233786622638652}
- component: {fileID: 2239866139065920034}
m_Layer: 0
m_Name: PlayerName
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8070823805368028938
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2505838817581327622}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 1.4999999, z: 0}
m_LocalScale: {x: 0.1, y: 0.1, z: 0.1}
m_Children: []
m_Father: {fileID: 5650773562400175449}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &9066655185906928051
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2505838817581327622}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!102 &4760233786622638652
TextMesh:
serializedVersion: 3
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2505838817581327622}
m_Text: RB Reliable
m_OffsetZ: 0
m_CharacterSize: 0.5
m_LineSpacing: 1
m_Anchor: 4
m_Alignment: 1
m_TabSize: 4
m_FontSize: 100
m_FontStyle: 0
m_RichText: 1
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_Color:
serializedVersion: 2
rgba: 4294967040
--- !u!114 &2239866139065920034
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2505838817581327622}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: afa2d590c474413d9fc183551385ed85, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &3564599214188516024 --- !u!1 &3564599214188516024
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -194,6 +300,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: m_Children:
- {fileID: 4320229852458648655} - {fileID: 4320229852458648655}
- {fileID: 8070823805368028938}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@ -1,5 +1,111 @@
%YAML 1.1 %YAML 1.1
%TAG !u! tag:unity3d.com,2011: %TAG !u! tag:unity3d.com,2011:
--- !u!1 &1900176203039934355
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4129545300081926521}
- component: {fileID: 6572775962608386051}
- component: {fileID: 3912971638250293984}
- component: {fileID: 4630973873820678624}
m_Layer: 0
m_Name: PlayerName
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4129545300081926521
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1900176203039934355}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 1.4999999, z: 0}
m_LocalScale: {x: 0.1, y: 0.1, z: 0.1}
m_Children: []
m_Father: {fileID: 6814142693731383418}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &6572775962608386051
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1900176203039934355}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!102 &3912971638250293984
TextMesh:
serializedVersion: 3
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1900176203039934355}
m_Text: RB Unreliable
m_OffsetZ: 0
m_CharacterSize: 0.5
m_LineSpacing: 1
m_Anchor: 4
m_Alignment: 1
m_TabSize: 4
m_FontSize: 100
m_FontStyle: 0
m_RichText: 1
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_Color:
serializedVersion: 2
rgba: 4278255615
--- !u!114 &4630973873820678624
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1900176203039934355}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: afa2d590c474413d9fc183551385ed85, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &2414815785185615771 --- !u!1 &2414815785185615771
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -194,6 +300,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: m_Children:
- {fileID: 3102887894851733868} - {fileID: 3102887894851733868}
- {fileID: 4129545300081926521}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@ -79,6 +79,112 @@ MeshRenderer:
m_SortingLayerID: 0 m_SortingLayerID: 0
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
--- !u!1 &5366675989284536270
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1545974004720046327}
- component: {fileID: 1128890847761595466}
- component: {fileID: 396193860522376263}
- component: {fileID: 6075803386746488465}
m_Layer: 0
m_Name: PlayerName
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1545974004720046327
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5366675989284536270}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 1.5, z: 0}
m_LocalScale: {x: 0.1, y: 0.1, z: 0.1}
m_Children: []
m_Father: {fileID: 4659514702152478195}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &1128890847761595466
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5366675989284536270}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!102 &396193860522376263
TextMesh:
serializedVersion: 3
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5366675989284536270}
m_Text: Reliable
m_OffsetZ: 0
m_CharacterSize: 0.5
m_LineSpacing: 1
m_Anchor: 4
m_Alignment: 1
m_TabSize: 4
m_FontSize: 100
m_FontStyle: 0
m_RichText: 1
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_Color:
serializedVersion: 2
rgba: 4294967040
--- !u!114 &6075803386746488465
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5366675989284536270}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: afa2d590c474413d9fc183551385ed85, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &5844787331012650587 --- !u!1 &5844787331012650587
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -195,6 +301,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: m_Children:
- {fileID: 3834521907656645861} - {fileID: 3834521907656645861}
- {fileID: 1545974004720046327}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@ -71,14 +71,6 @@ public override void ConfigureHeadlessFrameRate()
base.ConfigureHeadlessFrameRate(); base.ConfigureHeadlessFrameRate();
} }
/// <summary>
/// called when quitting the application by closing the window / pressing stop in the editor
/// </summary>
public override void OnApplicationQuit()
{
base.OnApplicationQuit();
}
#endregion #endregion
#region Scene Management #region Scene Management

View File

@ -159,6 +159,112 @@ MeshRenderer:
m_SortingLayerID: 0 m_SortingLayerID: 0
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
--- !u!1 &7554601580530514207
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8679949096303753939}
- component: {fileID: 3142866354055383265}
- component: {fileID: 8297296856940116434}
- component: {fileID: 1123801447343694564}
m_Layer: 0
m_Name: PlayerName
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8679949096303753939
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7554601580530514207}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 1.4999999, z: 0}
m_LocalScale: {x: 0.1, y: 0.1, z: 0.1}
m_Children: []
m_Father: {fileID: 4659514702152478195}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &3142866354055383265
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7554601580530514207}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!102 &8297296856940116434
TextMesh:
serializedVersion: 3
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7554601580530514207}
m_Text: Unreliable
m_OffsetZ: 0
m_CharacterSize: 0.5
m_LineSpacing: 1
m_Anchor: 4
m_Alignment: 1
m_TabSize: 4
m_FontSize: 100
m_FontStyle: 0
m_RichText: 1
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_Color:
serializedVersion: 2
rgba: 4278255615
--- !u!114 &1123801447343694564
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7554601580530514207}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: afa2d590c474413d9fc183551385ed85, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &7863680369626900553 --- !u!1 &7863680369626900553
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -195,6 +301,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: m_Children:
- {fileID: 3834521907656645861} - {fileID: 3834521907656645861}
- {fileID: 8679949096303753939}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@ -38,6 +38,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: m_Children:
- {fileID: 702109291309605218} - {fileID: 702109291309605218}
- {fileID: 1245118046271587945}
- {fileID: 8174595063106582951} - {fileID: 8174595063106582951}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
@ -197,7 +198,6 @@ MonoBehaviour:
maxTurnSpeed: 100 maxTurnSpeed: 100
turnAcceleration: 3 turnAcceleration: 3
runtimeData: runtimeData:
_horizontal: 0
_vertical: 0 _vertical: 0
_turnSpeed: 0 _turnSpeed: 0
_animVelocity: 0 _animVelocity: 0
@ -328,6 +328,112 @@ MonoBehaviour:
rotationSensitivity: 0.01 rotationSensitivity: 0.01
positionPrecision: 0.01 positionPrecision: 0.01
scalePrecision: 0.01 scalePrecision: 0.01
--- !u!1 &8370326626297540303
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1245118046271587945}
- component: {fileID: 2132579043257509693}
- component: {fileID: 7297775110981071875}
- component: {fileID: 755026988438523126}
m_Layer: 0
m_Name: PlayerName
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1245118046271587945
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8370326626297540303}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 4.5, z: 0}
m_LocalScale: {x: 0.1, y: 0.1, z: 0.1}
m_Children: []
m_Father: {fileID: 4659514702152478195}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &2132579043257509693
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8370326626297540303}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!102 &7297775110981071875
TextMesh:
serializedVersion: 3
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8370326626297540303}
m_Text: Reliable
m_OffsetZ: 0
m_CharacterSize: 0.5
m_LineSpacing: 1
m_Anchor: 4
m_Alignment: 1
m_TabSize: 4
m_FontSize: 100
m_FontStyle: 0
m_RichText: 1
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_Color:
serializedVersion: 2
rgba: 4294967040
--- !u!114 &755026988438523126
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8370326626297540303}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: afa2d590c474413d9fc183551385ed85, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &9109672380512621037 --- !u!1 &9109672380512621037
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -359,7 +465,7 @@ Transform:
m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} m_LocalScale: {x: 0.1, y: 0.1, z: 0.1}
m_Children: [] m_Children: []
m_Father: {fileID: 4659514702152478195} m_Father: {fileID: 4659514702152478195}
m_RootOrder: 1 m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &4153780752967283830 --- !u!23 &4153780752967283830
MeshRenderer: MeshRenderer:
@ -446,6 +552,11 @@ PrefabInstance:
propertyPath: m_Name propertyPath: m_Name
value: BasePrefab value: BasePrefab
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3638700596990361445, guid: dad07e68d3659e6439279d0d4110cf4c,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3638700596990361445, guid: dad07e68d3659e6439279d0d4110cf4c, - target: {fileID: 3638700596990361445, guid: dad07e68d3659e6439279d0d4110cf4c,
type: 3} type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x

View File

@ -38,6 +38,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: m_Children:
- {fileID: 702109291309605218} - {fileID: 702109291309605218}
- {fileID: 3980373565918037634}
- {fileID: 8174595063106582951} - {fileID: 8174595063106582951}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
@ -197,7 +198,6 @@ MonoBehaviour:
maxTurnSpeed: 100 maxTurnSpeed: 100
turnAcceleration: 3 turnAcceleration: 3
runtimeData: runtimeData:
_horizontal: 0
_vertical: 0 _vertical: 0
_turnSpeed: 0 _turnSpeed: 0
_animVelocity: 0 _animVelocity: 0
@ -328,6 +328,112 @@ MonoBehaviour:
positionSensitivity: 0.01 positionSensitivity: 0.01
rotationSensitivity: 0.01 rotationSensitivity: 0.01
scaleSensitivity: 0.01 scaleSensitivity: 0.01
--- !u!1 &8921157218750951074
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3980373565918037634}
- component: {fileID: 6676747655999921495}
- component: {fileID: 2065557788844610204}
- component: {fileID: 7150452883383585942}
m_Layer: 0
m_Name: PlayerName
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3980373565918037634
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8921157218750951074}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 4.5, z: 0}
m_LocalScale: {x: 0.1, y: 0.1, z: 0.1}
m_Children: []
m_Father: {fileID: 4659514702152478195}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &6676747655999921495
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8921157218750951074}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!102 &2065557788844610204
TextMesh:
serializedVersion: 3
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8921157218750951074}
m_Text: Unreliable
m_OffsetZ: 0
m_CharacterSize: 0.5
m_LineSpacing: 1
m_Anchor: 4
m_Alignment: 1
m_TabSize: 4
m_FontSize: 100
m_FontStyle: 0
m_RichText: 1
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_Color:
serializedVersion: 2
rgba: 4278255615
--- !u!114 &7150452883383585942
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8921157218750951074}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: afa2d590c474413d9fc183551385ed85, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &9109672380512621037 --- !u!1 &9109672380512621037
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -359,7 +465,7 @@ Transform:
m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} m_LocalScale: {x: 0.1, y: 0.1, z: 0.1}
m_Children: [] m_Children: []
m_Father: {fileID: 4659514702152478195} m_Father: {fileID: 4659514702152478195}
m_RootOrder: 1 m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &4153780752967283830 --- !u!23 &4153780752967283830
MeshRenderer: MeshRenderer:
@ -446,6 +552,11 @@ PrefabInstance:
propertyPath: m_Name propertyPath: m_Name
value: BasePrefab value: BasePrefab
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3638700596990361445, guid: dad07e68d3659e6439279d0d4110cf4c,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3638700596990361445, guid: dad07e68d3659e6439279d0d4110cf4c, - target: {fileID: 3638700596990361445, guid: dad07e68d3659e6439279d0d4110cf4c,
type: 3} type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x

View File

@ -8,7 +8,7 @@ Material:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_Name: Robot_Color m_Name: Robot_Color
m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} m_Shader: {fileID: 2, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: m_ShaderKeywords:
m_LightmapFlags: 1 m_LightmapFlags: 1
m_EnableInstancingVariants: 0 m_EnableInstancingVariants: 0
@ -24,7 +24,7 @@ Material:
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _BumpMap: - _BumpMap:
m_Texture: {fileID: 2800000, guid: a1454d7237641fa49a7f66d6bee624ad, type: 3} m_Texture: {fileID: 2800000, guid: 7bf5087089ac3424a982003c10dda35f, type: 3}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _EmissionMap: - _EmissionMap:
@ -32,7 +32,7 @@ Material:
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _MainTex: - _MainTex:
m_Texture: {fileID: 2800000, guid: 1fbb41709a1d9334696860db720026e5, type: 3} m_Texture: {fileID: 2800000, guid: fa652271323864a648c14b00ef5c677b, type: 3}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _SpecGlossMap: - _SpecGlossMap:

Binary file not shown.

After

Width:  |  Height:  |  Size: 482 KiB

View File

@ -0,0 +1,104 @@
fileFormatVersion: 2
guid: fa652271323864a648c14b00ef5c677b
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 1024
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 1024
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 MiB

View File

@ -1,45 +0,0 @@
fileFormatVersion: 2
guid: 1fbb41709a1d9334696860db720026e5
TextureImporter:
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spritePixelsToUnits: 100
alphaIsTransparency: 0
textureType: -1
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 KiB

View File

@ -0,0 +1,104 @@
fileFormatVersion: 2
guid: 7bf5087089ac3424a982003c10dda35f
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 1
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 1024
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 1024
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 MiB

View File

@ -1,45 +0,0 @@
fileFormatVersion: 2
guid: a1454d7237641fa49a7f66d6bee624ad
TextureImporter:
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 1
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 1
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spritePixelsToUnits: 100
alphaIsTransparency: 0
textureType: 1
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:

View File

@ -19,11 +19,6 @@ void Awake()
mainCam = Camera.main; mainCam = Camera.main;
} }
void OnDisable()
{
//Debug.Log("PlayerCamera.OnDisable");
}
public override void OnStartLocalPlayer() public override void OnStartLocalPlayer()
{ {
if (mainCam != null) if (mainCam != null)
@ -38,16 +33,46 @@ public override void OnStartLocalPlayer()
Debug.LogWarning("PlayerCamera: Could not find a camera in scene with 'MainCamera' tag."); Debug.LogWarning("PlayerCamera: Could not find a camera in scene with 'MainCamera' tag.");
} }
void OnApplicationQuit()
{
//Debug.Log("PlayerCamera.OnApplicationQuit");
ReleaseCamera();
}
public override void OnStopLocalPlayer() public override void OnStopLocalPlayer()
{
//Debug.Log("PlayerCamera.OnStopLocalPlayer");
ReleaseCamera();
}
void OnDisable()
{
//Debug.Log("PlayerCamera.OnDisable");
ReleaseCamera();
}
void OnDestroy()
{
//Debug.Log("PlayerCamera.OnDestroy");
ReleaseCamera();
}
void ReleaseCamera()
{ {
if (mainCam != null && mainCam.transform.parent == transform) if (mainCam != null && mainCam.transform.parent == transform)
{ {
//Debug.Log("PlayerCamera.ReleaseCamera");
mainCam.transform.SetParent(null); mainCam.transform.SetParent(null);
SceneManager.MoveGameObjectToScene(mainCam.gameObject, SceneManager.GetActiveScene());
mainCam.orthographic = true; mainCam.orthographic = true;
mainCam.orthographicSize = 15f; mainCam.orthographicSize = 15f;
mainCam.transform.localPosition = new Vector3(0f, 70f, 0f); mainCam.transform.localPosition = new Vector3(0f, 70f, 0f);
mainCam.transform.localEulerAngles = new Vector3(90f, 0f, 0f); mainCam.transform.localEulerAngles = new Vector3(90f, 0f, 0f);
if (mainCam.gameObject.scene != SceneManager.GetActiveScene())
SceneManager.MoveGameObjectToScene(mainCam.gameObject, SceneManager.GetActiveScene());
mainCam = null;
} }
} }
} }

View File

@ -1341,7 +1341,15 @@ public void TestNullList()
Assert.That(readList, Is.Null); Assert.That(readList, Is.Null);
} }
[Test, Ignore("TODO")] // writer.Write<T> for HashSet only works if it's actually used by weaver somewhere.
// so for TestHashSet() to pass, we need to pretend using a HashSet<int> somewhere.
class HashSetNetworkBehaviour : NetworkBehaviour
{
[Command]
public void CmdHashSet(HashSet<int> hashSet) {}
}
[Test] // requires HashSetNetworkBehaviour to exits!
public void TestHashSet() public void TestHashSet()
{ {
HashSet<int> original = new HashSet<int>() { 1, 2, 3, 4, 5 }; HashSet<int> original = new HashSet<int>() { 1, 2, 3, 4, 5 };
@ -1353,7 +1361,7 @@ public void TestHashSet()
Assert.That(readHashSet, Is.EqualTo(original)); Assert.That(readHashSet, Is.EqualTo(original));
} }
[Test, Ignore("TODO")] [Test] // requires HashSetNetworkBehaviour to exits!
public void TestNullHashSet() public void TestNullHashSet()
{ {
NetworkWriter writer = new NetworkWriter(); NetworkWriter writer = new NetworkWriter();

View File

@ -323,7 +323,7 @@ public void SetServerLobbyParams(LobbyCreateRequest request)
_request = request; _request = request;
} }
private void OnDestroy() public override void OnDestroy()
{ {
// attempt to clean up lobbies, if active // attempt to clean up lobbies, if active
if (NetworkServer.active) if (NetworkServer.active)
@ -340,6 +340,8 @@ private void OnDestroy()
// sorry. this can go once the lobby service can timeout lobbies itself // sorry. this can go once the lobby service can timeout lobbies itself
Thread.Sleep(300); Thread.Sleep(300);
} }
base.OnDestroy();
} }
} }
} }

View File

@ -116,7 +116,7 @@ protected virtual void Awake()
() => OnClientConnected.Invoke(), () => OnClientConnected.Invoke(),
(message, channel) => OnClientDataReceived.Invoke(message, FromKcpChannel(channel)), (message, channel) => OnClientDataReceived.Invoke(message, FromKcpChannel(channel)),
() => OnClientDisconnected?.Invoke(), // may be null in StopHost(): https://github.com/MirrorNetworking/Mirror/issues/3708 () => OnClientDisconnected?.Invoke(), // may be null in StopHost(): https://github.com/MirrorNetworking/Mirror/issues/3708
(error, reason) => OnClientError.Invoke(ToTransportError(error), reason), (error, reason) => OnClientError?.Invoke(ToTransportError(error), reason), // may be null during shutdown: https://github.com/MirrorNetworking/Mirror/issues/3876
config config
); );

View File

@ -197,11 +197,10 @@ void EnsureThread()
Debug.Log($"ThreadedTransport: started worker thread!"); Debug.Log($"ThreadedTransport: started worker thread!");
} }
protected virtual void OnDestroy() public override void OnDestroy()
{ {
// stop thread fully // stop thread fully
Shutdown(); base.OnDestroy();
// TODO recycle writers. // TODO recycle writers.
} }

View File

@ -68,14 +68,6 @@ public class #SCRIPTNAME# : NetworkManager
base.ConfigureHeadlessFrameRate(); base.ConfigureHeadlessFrameRate();
} }
/// <summary>
/// called when quitting the application by closing the window / pressing stop in the editor
/// </summary>
public override void OnApplicationQuit()
{
base.OnApplicationQuit();
}
#endregion #endregion
#region Scene Management #region Scene Management

View File

@ -15,8 +15,6 @@ public class #SCRIPTNAME# : NetworkManager
public event Action OnStartAction; public event Action OnStartAction;
public event Action OnDestroyAction; public event Action OnDestroyAction;
public event Action OnApplicationQuitAction;
public event Action<string> ServerChangeSceneAction; public event Action<string> ServerChangeSceneAction;
public event Action<string> OnServerChangeSceneAction; public event Action<string> OnServerChangeSceneAction;
public event Action<string> OnServerSceneChangedAction; public event Action<string> OnServerSceneChangedAction;
@ -117,15 +115,6 @@ public class #SCRIPTNAME# : NetworkManager
base.ConfigureHeadlessFrameRate(); base.ConfigureHeadlessFrameRate();
} }
/// <summary>
/// called when quitting the application by closing the window / pressing stop in the editor
/// </summary>
public override void OnApplicationQuit()
{
OnApplicationQuitAction?.Invoke();
base.OnApplicationQuit();
}
#endregion #endregion
#region Scene Management #region Scene Management