feature: Stinkysteak benchmark (#3690)

* wip

* add dependencies

* OnGUI

* timer license updated
This commit is contained in:
mischa 2023-12-05 09:52:15 +01:00 committed by GitHub
parent e2d63a88b0
commit f1bb7e4543
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
81 changed files with 5336 additions and 0 deletions

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d21d00f41432a4816ac9c0b70d8be22d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,33 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b345aa8c625f48c42b128a3818160fa1, type: 3}
m_Name: BehaviourConfig
m_EditorClassIdentifier:
_moveBehaviour:
SinYMove:
_minSpeed: 0.5
_maxSpeed: 1
_minAmplitude: 0.5
_maxAmplitude: 1
_positionMaxRandom: 100
SinAllAxisMove:
_minSpeed: 0.5
_maxSpeed: 1
_amplitude: 50
WanderMove:
_circleRadius: 35
_turnChance: 0.05
_maxRadius: 2000
_mass: 15
_maxSpeed: 3
_maxForce: 15
_maxSpawnPositionRadius: 100

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7d859fe3222918f4e9b2fe25afa82ced
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 913218514ba0544029c119cb49d8a73c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6212bba711d2346469b9b11112c59a43
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 StinkySteak
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b0c6073310113462d96a86bea89ec4ea
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,63 @@
# Simulation Timer
An Lightweight Efficient Timer for Unity. Inspired by Photon Fusion TickTimer
## Usage/Examples
#### Simulation Timer
![](https://github.com/StinkySteak/com.stinkysteak.simulationtimer/blob/main/Gif/DefaultTimer.gif)
```csharp
private SimulationTimer _disableTimer;
private void Start()
{
_disableTimer = SimulationTimer.CreateFromSeconds(_delay);
}
private void Update()
{
if(_disableTimer.IsExpired())
{
_gameObject.SetActive(false);
_disableTimer = SimulationTimer.None;
}
}
```
#### Pauseable Simulation Timer
![](https://github.com/StinkySteak/com.stinkysteak.simulationtimer/blob/main/Gif/PauseableTimer.gif)
```csharp
private PauseableSimulationTimer _timer;
public PauseableSimulationTimer Timer => _timer;
private void Start()
{
_timer = PauseableSimulationTimer.CreateFromSeconds(_delay);
}
public void TogglePause()
{
if(!_timer.IsPaused)
{
_timer.Pause();
return;
}
_timer.Resume();
}
private void Update()
{
if(_timer.IsExpired())
{
_gameObject.SetActive(false);
_timer = PauseableSimulationTimer.None;
}
}
```
## Class Reference
`SimulationTimer`: Default Timer
`PauseableTimer`: Pauseable Timer

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: ee0478529536d0c4982dac64c0021021
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 97dc55e998bbf3443b386473b013a62c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,63 @@
using UnityEngine;
namespace StinkySteak.SimulationTimer
{
public struct PauseableSimulationTimer
{
public static PauseableSimulationTimer None => default;
private float _targetTime;
private bool _isPaused;
private float _pauseAtTime;
public float TargetTime => GetTargetTime();
public bool IsPaused => _isPaused;
private float GetTargetTime()
{
if (!_isPaused)
{
return _targetTime;
}
return _targetTime + Time.time - _pauseAtTime;
}
public static PauseableSimulationTimer CreateFromSeconds(float duration)
{
return new PauseableSimulationTimer()
{
_targetTime = duration + Time.time
};
}
public void Pause()
{
if (_isPaused) return;
_isPaused = true;
_pauseAtTime = Time.time;
}
public void Resume()
{
if (!_isPaused) return;
_targetTime = GetTargetTime();
_isPaused = false;
_pauseAtTime = 0;
}
public bool IsRunning => _targetTime > 0;
public bool IsExpired()
=> Time.time >= TargetTime && IsRunning;
public bool IsExpiredOrNotRunning()
=> Time.time >= TargetTime;
public float RemainingSeconds
=> Mathf.Max(TargetTime - Time.time, 0);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b1ad3772cd6fb4848a960ac3a397aaa0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,32 @@
using UnityEngine;
namespace StinkySteak.SimulationTimer
{
public struct SimulationTimer
{
public static SimulationTimer None => default;
private float _targetTime;
public float TargetTime => _targetTime;
public static SimulationTimer CreateFromSeconds(float duration)
{
return new SimulationTimer()
{
_targetTime = duration + Time.time
};
}
public bool IsRunning => _targetTime > 0;
public bool IsExpired()
=> Time.time >= _targetTime && IsRunning;
public bool IsExpiredOrNotRunning()
=> Time.time >= _targetTime;
public float RemainingSeconds
=> Mathf.Max(_targetTime - Time.time, 0);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c3dc5b6ba56d2c94b8078dc70de8d5c1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,15 @@
{
"name": "com.stinkysteak.simulationtimer",
"version": "0.1.0",
"displayName": "Simulation Timer",
"description": "Efficient and Scalable Frame Timer",
"unity": "2021.3",
"documentationUrl": "https://github.com/StinkySteak/com.stinkysteak.simulationtimer",
"changelogUrl": "https://github.com/StinkySteak/com.stinkysteak.simulationtimer/blob/main/CHANGELOG.md",
"licensesUrl": "https://github.com/StinkySteak/com.stinkysteak.simulationtimer/blob/main/LICENSE.md",
"author": {
"name": "Stinkysteak",
"email": "stinkysteak@steaksoft.com",
"url": "https://steaksoft.net"
}
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: eb3de65e983cc7f4caaed498f0a300ff
PackageManifestImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5ead20b35ad40400f930ea8975fdd0f7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 StinkySteak
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 449c20116b4724976879aadb9b214c25
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f29a212f88aa64554ace6bf12e0a6349
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8d1a99d840d22d84c9531fc200edf547
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,33 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b345aa8c625f48c42b128a3818160fa1, type: 3}
m_Name: DefaultBehaviourConfig
m_EditorClassIdentifier:
_moveBehaviour:
SinYMove:
_minSpeed: 0.5
_maxSpeed: 1
_minAmplitude: 0.5
_maxAmplitude: 1
_positionMaxRandom: 100
SinAllAxisMove:
_minSpeed: 0.5
_maxSpeed: 1
_amplitude: 50
WanderMove:
_circleRadius: 35
_turnChance: 0.05
_maxRadius: 2000
_mass: 15
_maxSpeed: 3
_maxForce: 15
_maxSpawnPositionRadius: 100

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c840c2115726fe44a9fea3d815aa2a44
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 402a222d39bcec04c9a4a579f7f34d00
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 6e6b75e5db829b54ba9287ce8d21b551
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6298f96b397ee4445b27e31637dd916b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,45 @@
using UnityEngine;
namespace StinkySteak.NetcodeBenchmark
{
[CreateAssetMenu(fileName = nameof(BehaviourConfig), menuName = "Netcode Benchmark/Behaviour Config")]
public class BehaviourConfig : ScriptableObject
{
[SerializeField] private MoveBehaviour _moveBehaviour;
[System.Serializable]
public struct MoveBehaviour
{
public SinMoveYWrapper SinYMove;
public SinRandomMoveWrapper SinAllAxisMove;
public WanderMoveWrapper WanderMove;
public void CreateDefault()
{
SinYMove = SinMoveYWrapper.CreateDefault();
SinAllAxisMove = SinRandomMoveWrapper.CreateDefault();
WanderMove = WanderMoveWrapper.CreateDefault();
}
}
private void Reset()
{
_moveBehaviour.CreateDefault();
}
public void ApplyConfig(ref SinMoveYWrapper wrapper)
{
wrapper = _moveBehaviour.SinYMove;
}
public void ApplyConfig(ref SinRandomMoveWrapper wrapper)
{
wrapper = _moveBehaviour.SinAllAxisMove;
}
public void ApplyConfig(ref WanderMoveWrapper wrapper)
{
wrapper = _moveBehaviour.WanderMove;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b345aa8c625f48c42b128a3818160fa1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6dc3396f4b66601449c872b2527234f7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,10 @@
using UnityEngine;
namespace StinkySteak.NetcodeBenchmark
{
public interface IMoveWrapper
{
void NetworkStart(Transform transform);
void NetworkUpdate(Transform transform);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 62941d180260d4743b36d0b3214ca3b4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,45 @@
using UnityEngine;
namespace StinkySteak.NetcodeBenchmark
{
[System.Serializable]
public struct SinMoveYWrapper : IMoveWrapper
{
[SerializeField] private float _minSpeed;
[SerializeField] private float _maxSpeed;
[SerializeField] private float _minAmplitude;
[SerializeField] private float _maxAmplitude;
[SerializeField] private float _positionMaxRandom;
private Vector3 _initialPosition;
private float _speed;
private float _amplitude;
public static SinMoveYWrapper CreateDefault()
{
SinMoveYWrapper wrapper = new();
wrapper._minSpeed = 0.5f;
wrapper._maxSpeed = 1f;
wrapper._minAmplitude = 0.5f;
wrapper._maxAmplitude = 1f;
wrapper._positionMaxRandom = 5f;
return wrapper;
}
public void NetworkStart(Transform transform)
{
_speed = Random.Range(_minSpeed, _maxSpeed);
_amplitude = Random.Range(_minAmplitude, _maxAmplitude);
_initialPosition = RandomVector3.Get(_positionMaxRandom);
}
public void NetworkUpdate(Transform transform)
{
float sin = Mathf.Sin(Time.time * _speed) * _amplitude;
transform.position = _initialPosition + (Vector3.up * sin);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2a8c50aebdfe1ad42bfa887f78c8892f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,40 @@
using UnityEngine;
namespace StinkySteak.NetcodeBenchmark
{
[System.Serializable]
public struct SinRandomMoveWrapper : IMoveWrapper
{
[SerializeField] private float _minSpeed;
[SerializeField] private float _maxSpeed;
[SerializeField] private float _amplitude;
private Vector3 _targetPosition;
private Vector3 _initialPosition;
private float _speed;
public static SinRandomMoveWrapper CreateDefault()
{
SinRandomMoveWrapper wrapper = new();
wrapper._minSpeed = 1f;
wrapper._maxSpeed = 1f;
wrapper._amplitude = 1f;
return wrapper;
}
public void NetworkStart(Transform transform)
{
_speed = Random.Range(_minSpeed, _maxSpeed);
_targetPosition = RandomVector3.Get(1f);
}
public void NetworkUpdate(Transform transform)
{
float sin = Mathf.Sin(Time.time * _speed) * _amplitude;
transform.position = _initialPosition + (_targetPosition * sin);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3584eba3ddc985c409f283d204fea105
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,86 @@
using UnityEngine;
namespace StinkySteak.NetcodeBenchmark
{
[System.Serializable]
public struct WanderMoveWrapper : IMoveWrapper
{
[SerializeField] private float _circleRadius;
[SerializeField] private float _turnChance;
[SerializeField] private float _maxRadius;
[SerializeField] private float _mass;
[SerializeField] private float _maxSpeed;
[SerializeField] private float _maxForce;
[SerializeField] private float _maxSpawnPositionRadius;
private Vector3 _velocity;
private Vector3 _wanderForce;
private Vector3 _target;
public static WanderMoveWrapper CreateDefault()
{
WanderMoveWrapper data = new WanderMoveWrapper();
data._circleRadius = 1;
data._turnChance = 0.05f;
data._maxRadius = 5;
data._mass = 15;
data._maxSpeed = 3;
data._maxForce = 15;
return data;
}
public void NetworkStart(Transform transform)
{
_velocity = Random.onUnitSphere;
_wanderForce = GetRandomWanderForce();
transform.position = RandomVector3.Get(_maxSpawnPositionRadius);
}
public void NetworkUpdate(Transform transform)
{
var desiredVelocity = GetWanderForce(transform);
desiredVelocity = desiredVelocity.normalized * _maxSpeed;
var steeringForce = desiredVelocity - _velocity;
steeringForce = Vector3.ClampMagnitude(steeringForce, _maxForce);
steeringForce /= _mass;
_velocity = Vector3.ClampMagnitude(_velocity + steeringForce, _maxSpeed);
transform.position += _velocity * Time.deltaTime;
transform.forward = _velocity.normalized;
Debug.DrawRay(transform.position, _velocity.normalized * 2, Color.green);
Debug.DrawRay(transform.position, desiredVelocity.normalized * 2, Color.magenta);
}
private Vector3 GetWanderForce(Transform transform)
{
if (transform.position.magnitude > _maxRadius)
{
var directionToCenter = (_target - transform.position).normalized;
_wanderForce = _velocity.normalized + directionToCenter;
}
else if (Random.value < _turnChance)
{
_wanderForce = GetRandomWanderForce();
}
return _wanderForce;
}
private Vector3 GetRandomWanderForce()
{
var circleCenter = _velocity.normalized;
var randomPoint = Random.insideUnitCircle;
var displacement = new Vector3(randomPoint.x, randomPoint.y) * _circleRadius;
displacement = Quaternion.LookRotation(_velocity) * displacement;
var wanderForce = circleCenter + displacement;
return wanderForce;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5e236bbe49894bf4f972fe81f2081c8a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,16 @@
using UnityEngine;
namespace StinkySteak.NetcodeBenchmark
{
public static class RandomVector3
{
public static Vector3 Get(float max)
{
float x = Random.Range(-max, max);
float y = Random.Range(-max, max);
float z = Random.Range(-max, max);
return new Vector3(x, y, z);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 17d9458a0ed386d4281f9c5085b42118
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ae950d5124e344a46a2f1aa4dc532bc8
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,94 @@
// using TMPro; // MIRROR CHANGE
using UnityEngine;
using UnityEngine.UI;
namespace StinkySteak.NetcodeBenchmark
{
public class BaseGUIGame : MonoBehaviour
{
// [SerializeField] private Button _buttonStartServer; // MIRROR CHANGE: Canvas + TextMeshPro -> OnGUI
// [SerializeField] private Button _buttonStartClient; // MIRROR CHANGE: Canvas + TextMeshPro -> OnGUI
[Space]
// MIRROR CHANGE
protected string _textLatency = ""; // [SerializeField] protected TextMesh _textLatency; // MIRROR CHANGE: Canvas + TextMeshPro -> OnGUI
[SerializeField] private float _updateLatencyTextInterval = 1f;
private SimulationTimer.SimulationTimer _timerUpdateLatencyText;
[Header("Stress Test 1: Move Y")]
[SerializeField] protected StressTestEssential _test_1;
[Header("Stress Test 2: Move All Axis")]
[SerializeField] protected StressTestEssential _test_2;
[Header("Stress Test 3: Move Wander")]
[SerializeField] protected StressTestEssential _test_3;
[System.Serializable]
public struct StressTestEssential
{
// public Button ButtonExecute; // MIRROR CHANGE: Canvas + TextMeshPro -> OnGUI
public int SpawnCount;
public GameObject Prefab;
}
private void Start()
{
Initialize();
}
// MIRROR CHANGE: OnGUI instead of Canvas + TextMeshPro
protected virtual void Initialize()
{
// _test_1.ButtonExecute.onClick.AddListener(StressTest_1);
// _test_2.ButtonExecute.onClick.AddListener(StressTest_2);
// _test_3.ButtonExecute.onClick.AddListener(StressTest_3);
//
// _buttonStartServer.onClick.AddListener(StartServer);
// _buttonStartClient.onClick.AddListener(StartClient);
}
protected virtual void OnCustomGUI() {}
protected virtual void OnGUI()
{
GUILayout.BeginArea(new Rect(100, 100, 300, 400));
if (GUILayout.Button("Stress Test 1"))
{
StressTest_1();
}
if (GUILayout.Button("Stress Test 2"))
{
StressTest_2();
}
if (GUILayout.Button("Stress Test 3"))
{
StressTest_3();
}
OnCustomGUI();
GUILayout.Label(_textLatency);
GUILayout.EndArea();
}
// END MIRROR CHANGE
protected virtual void StartClient() { }
protected virtual void StartServer() { }
private void StressTest_1() => StressTest(_test_1);
private void StressTest_2() => StressTest(_test_2);
private void StressTest_3() => StressTest(_test_3);
protected virtual void StressTest(StressTestEssential stressTest) { }
private void LateUpdate()
{
if (!_timerUpdateLatencyText.IsExpiredOrNotRunning()) return;
UpdateNetworkStats();
_timerUpdateLatencyText = SimulationTimer.SimulationTimer.CreateFromSeconds(_updateLatencyTextInterval);
}
protected virtual void UpdateNetworkStats() { }
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0f64aeea8d696ff4fbb80a37fad8ebd8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 65744866da2028e4fab6871830543ca5
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,28 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Unlit
m_Shader: {fileID: 4800000, guid: 2126a83145dd7bc48959270850637c77, type: 3}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 0
m_EnableInstancingVariants: 1
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs: []
m_Ints: []
m_Floats:
- __dirty: 0
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
m_BuildTextureStacks: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: aa7b0f2a00af4ef4bac3c70fb2c798eb
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,37 @@
Shader "Unlit"
{
Properties
{
_Color("Color", Color) = (1,1,1,1)
[HideInInspector] __dirty( "", Int ) = 1
}
SubShader
{
Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" "IsEmissive" = "true" }
Cull Back
CGPROGRAM
#pragma target 3.0
#pragma surface surf Unlit keepalpha addshadow fullforwardshadows
struct Input
{
half filler;
};
uniform float4 _Color;
inline half4 LightingUnlit( SurfaceOutput s, half3 lightDir, half atten )
{
return half4 ( 0, 0, 0, s.Alpha );
}
void surf( Input i , inout SurfaceOutput o )
{
o.Emission = _Color.rgb;
o.Alpha = 1;
}
ENDCG
}
Fallback "Diffuse"
}

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 2126a83145dd7bc48959270850637c77
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 StinkySteak
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 47c281457363740d58cafc331b207e35
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,337 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.37311924, g: 0.38073963, b: 0.3587269, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 12
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 500
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 2
m_PVRDenoiserTypeDirect: 0
m_PVRDenoiserTypeIndirect: 0
m_PVRDenoiserTypeAO: 0
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 0
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_LightingSettings: {fileID: 0}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &711140055
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 711140058}
- component: {fileID: 711140057}
- component: {fileID: 711140056}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &711140056
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 711140055}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SendPointerHoverToParent: 1
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
m_CancelButton: Cancel
m_InputActionsPerSecond: 10
m_RepeatDelay: 0.5
m_ForceModuleActive: 0
--- !u!114 &711140057
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 711140055}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1
m_DragThreshold: 10
--- !u!4 &711140058
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 711140055}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &963194225
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 963194228}
- component: {fileID: 963194227}
- component: {fileID: 963194226}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &963194226
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 963194225}
m_Enabled: 1
--- !u!20 &963194227
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 963194225}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 2
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &963194228
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 963194225}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -20}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1186661038
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1186661040}
- component: {fileID: 1186661039}
m_Layer: 0
m_Name: GUIGame_OnGUI // MIRROR CHANGE
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1186661039
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1186661038}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 89b59180da8577947a00064507b6f488, type: 3}
m_Name:
m_EditorClassIdentifier:
_textLatency: {fileID: 0}
_updateLatencyTextInterval: 1
_test_1:
SpawnCount: 500
Prefab: {fileID: 2997158864174378348, guid: 296e7798207e69a40a871087348da0c3,
type: 3}
_test_2:
SpawnCount: 500
Prefab: {fileID: 6859501204968983109, guid: a7278693f35741148b381178a112e24d,
type: 3}
_test_3:
SpawnCount: 500
Prefab: {fileID: 6660102892434074099, guid: 9925ea7d66c38ac48a88a572a9236cbe,
type: 3}
_networkManagerPrefab: {fileID: 6902534888765376180, guid: 62d3b9c46c08c934ea2ac02811b3028d,
type: 3}
--- !u!4 &1186661040
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1186661038}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -8.328793, y: -9.683151, z: 3.160122}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9fc0d4010bbf28b4594072e72b8655ab
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3c9c530e587fbf14ab144ab380ea96e3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 7c764c613d90a5e4eb9ae8c5f2483eca
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,107 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6902534888765376181
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6902534888765376183}
- component: {fileID: 6902534888765376180}
- component: {fileID: 6712455278405722842}
m_Layer: 0
m_Name: NetworkManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6902534888765376183
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6902534888765376181}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &6902534888765376180
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6902534888765376181}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8aab4c8111b7c411b9b92cf3dbc5bd4e, type: 3}
m_Name:
m_EditorClassIdentifier:
dontDestroyOnLoad: 1
runInBackground: 1
autoStartServerBuild: 1
autoConnectClientBuild: 0
sendRate: 20
offlineScene:
onlineScene:
transport: {fileID: 6712455278405722842}
networkAddress: localhost
maxConnections: 100
disconnectInactiveConnections: 0
disconnectInactiveTimeout: 60
authenticator: {fileID: 0}
playerPrefab: {fileID: 388937345275023605, guid: fc40b1557a4729e4e9cfaad99e1097ff, type: 3}
autoCreatePlayer: 1
playerSpawnMethod: 0
spawnPrefabs: []
exceptionsDisconnect: 1
snapshotSettings:
bufferTimeMultiplier: 2
bufferLimit: 32
catchupNegativeThreshold: -1
catchupPositiveThreshold: 1
catchupSpeed: 0.019999999552965164
slowdownSpeed: 0.03999999910593033
driftEmaDuration: 1
dynamicAdjustment: 1
dynamicAdjustmentTolerance: 1
deliveryTimeEmaDuration: 2
connectionQualityInterval: 3
timeInterpolationGui: 0
--- !u!114 &6712455278405722842
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6902534888765376181}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6b0fecffa3f624585964b0d0eb21b18e, type: 3}
m_Name:
m_EditorClassIdentifier:
port: 25565
DualMode: 1
NoDelay: 1
Interval: 10
Timeout: 10000
RecvBufferSize: 7361536
SendBufferSize: 7361536
FastResend: 2
ReceiveWindowSize: 4096
SendWindowSize: 4096
MaxRetransmit: 40
MaximizeSocketBuffers: 1
ReliableMaxMessageSize: 297433
UnreliableMaxMessageSize: 1195
debugLog: 0
statisticsGUI: 0
statisticsLog: 0

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 62d3b9c46c08c934ea2ac02811b3028d
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,51 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &388937345275023605
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 388937345275023603}
- component: {fileID: 388937345275023604}
m_Layer: 0
m_Name: PlayerDummy
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &388937345275023603
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 388937345275023605}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &388937345275023604
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 388937345275023605}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9b91ecbcc199f4492b9a91e820070131, type: 3}
m_Name:
m_EditorClassIdentifier:
sceneId: 0
_assetId: 0
serverOnly: 0
visible: 0
hasSpawned: 0

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: fc40b1557a4729e4e9cfaad99e1097ff
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,186 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6859501204968983109
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6859501204968983104}
- component: {fileID: 6859501204968983110}
- component: {fileID: 6859501204968983108}
- component: {fileID: 4164372541306329233}
m_Layer: 0
m_Name: SphereMoveAllAxis
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6859501204968983104
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6859501204968983109}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 6859501205988317068}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &6859501204968983110
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6859501204968983109}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1a33ff1aaf3c582459143cebb4ab7cf9, type: 3}
m_Name:
m_EditorClassIdentifier:
syncDirection: 0
syncMode: 0
syncInterval: 0
_config: {fileID: 11400000, guid: 7d859fe3222918f4e9b2fe25afa82ced, type: 2}
--- !u!114 &6859501204968983108
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6859501204968983109}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9b91ecbcc199f4492b9a91e820070131, type: 3}
m_Name:
m_EditorClassIdentifier:
sceneId: 0
_assetId: 3552600046
serverOnly: 0
visible: 0
hasSpawned: 0
--- !u!114 &4164372541306329233
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6859501204968983109}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a553cb17010b2403e8523b558bffbc14, type: 3}
m_Name:
m_EditorClassIdentifier:
syncDirection: 0
syncMode: 0
syncInterval: 0
target: {fileID: 6859501204968983104}
syncPosition: 1
syncRotation: 1
syncScale: 0
interpolatePosition: 1
interpolateRotation: 1
interpolateScale: 1
coordinateSpace: 0
sendIntervalMultiplier: 1
timelineOffset: 0
showGizmos: 0
showOverlay: 0
overlayColor: {r: 0, g: 0, b: 0, a: 0.5}
onlySyncOnChange: 1
bufferResetMultiplier: 3
positionSensitivity: 0.01
rotationSensitivity: 0.01
scaleSensitivity: 0.01
--- !u!1 &6859501205988317069
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6859501205988317068}
- component: {fileID: 6859501205988317070}
- component: {fileID: 6859501205988317071}
m_Layer: 0
m_Name: Visual
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6859501205988317068
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6859501205988317069}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 6859501204968983104}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &6859501205988317070
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6859501205988317069}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &6859501205988317071
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6859501205988317069}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 1a4e2bf0f982f8341a79b69aaaadcf24, type: 2}
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
m_AdditionalVertexStreams: {fileID: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a7278693f35741148b381178a112e24d
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,186 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6660102891578011557
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6660102891578011556}
- component: {fileID: 6660102891578011558}
- component: {fileID: 6660102891578011559}
m_Layer: 0
m_Name: Visual
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6660102891578011556
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6660102891578011557}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 6660102892434074098}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &6660102891578011558
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6660102891578011557}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &6660102891578011559
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6660102891578011557}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 1a4e2bf0f982f8341a79b69aaaadcf24, type: 2}
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
m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &6660102892434074099
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6660102892434074098}
- component: {fileID: 6660102892434074109}
- component: {fileID: 6660102892434074110}
- component: {fileID: 3719388534151151571}
m_Layer: 0
m_Name: SphereMoveWander
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6660102892434074098
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6660102892434074099}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 6660102891578011556}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &6660102892434074109
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6660102892434074099}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c98d55e9b7394a94d97efd119d590ecf, type: 3}
m_Name:
m_EditorClassIdentifier:
syncDirection: 0
syncMode: 0
syncInterval: 0
_config: {fileID: 11400000, guid: 7d859fe3222918f4e9b2fe25afa82ced, type: 2}
--- !u!114 &6660102892434074110
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6660102892434074099}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9b91ecbcc199f4492b9a91e820070131, type: 3}
m_Name:
m_EditorClassIdentifier:
sceneId: 0
_assetId: 3743950749
serverOnly: 0
visible: 0
hasSpawned: 0
--- !u!114 &3719388534151151571
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6660102892434074099}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a553cb17010b2403e8523b558bffbc14, type: 3}
m_Name:
m_EditorClassIdentifier:
syncDirection: 0
syncMode: 0
syncInterval: 0
target: {fileID: 6660102892434074098}
syncPosition: 1
syncRotation: 1
syncScale: 0
interpolatePosition: 1
interpolateRotation: 1
interpolateScale: 1
coordinateSpace: 0
sendIntervalMultiplier: 1
timelineOffset: 0
showGizmos: 0
showOverlay: 0
overlayColor: {r: 0, g: 0, b: 0, a: 0.5}
onlySyncOnChange: 1
bufferResetMultiplier: 3
positionSensitivity: 0.01
rotationSensitivity: 0.01
scaleSensitivity: 0.01

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9925ea7d66c38ac48a88a572a9236cbe
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,186 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &2997158862366106693
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2997158862366106698}
- component: {fileID: 2997158862366106696}
- component: {fileID: 2997158862366106699}
m_Layer: 0
m_Name: Visual
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2997158862366106698
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2997158862366106693}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 2997158864174378353}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &2997158862366106696
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2997158862366106693}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &2997158862366106699
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2997158862366106693}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 1a4e2bf0f982f8341a79b69aaaadcf24, type: 2}
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
m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &2997158864174378348
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2997158864174378353}
- component: {fileID: 2997158864174378352}
- component: {fileID: 2997158864174378349}
- component: {fileID: 8058470056856446765}
m_Layer: 0
m_Name: SphereMoveY
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2997158864174378353
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2997158864174378348}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2997158862366106698}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2997158864174378352
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2997158864174378348}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 547d19395b603714c81fc33bfe0f37ca, type: 3}
m_Name:
m_EditorClassIdentifier:
syncDirection: 0
syncMode: 0
syncInterval: 0
_config: {fileID: 11400000, guid: 7d859fe3222918f4e9b2fe25afa82ced, type: 2}
--- !u!114 &2997158864174378349
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2997158864174378348}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9b91ecbcc199f4492b9a91e820070131, type: 3}
m_Name:
m_EditorClassIdentifier:
sceneId: 0
_assetId: 75128280
serverOnly: 0
visible: 0
hasSpawned: 0
--- !u!114 &8058470056856446765
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2997158864174378348}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a553cb17010b2403e8523b558bffbc14, type: 3}
m_Name:
m_EditorClassIdentifier:
syncDirection: 0
syncMode: 0
syncInterval: 0
target: {fileID: 2997158864174378353}
syncPosition: 1
syncRotation: 1
syncScale: 0
interpolatePosition: 1
interpolateRotation: 1
interpolateScale: 1
coordinateSpace: 0
sendIntervalMultiplier: 1
timelineOffset: 0
showGizmos: 0
showOverlay: 0
overlayColor: {r: 0, g: 0, b: 0, a: 0.5}
onlySyncOnChange: 1
bufferResetMultiplier: 3
positionSensitivity: 0.01
rotationSensitivity: 0.01
scaleSensitivity: 0.01

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 296e7798207e69a40a871087348da0c3
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a5f21760ef33f344a8be5294af5a64e9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,65 @@
using Mirror;
using StinkySteak.NetcodeBenchmark;
using UnityEngine;
namespace StinkySteak.MirrorBenchmark
{
public class GUIGame : BaseGUIGame
{
[SerializeField] private NetworkManager _networkManagerPrefab;
private NetworkManager _networkManager;
protected override void Initialize()
{
base.Initialize();
_networkManager = Instantiate(_networkManagerPrefab);
RegisterPrefabs(new StressTestEssential[] { _test_1, _test_2, _test_3 });
}
private void RegisterPrefabs(StressTestEssential[] stressTestEssential)
{
for (int i = 0; i < stressTestEssential.Length; i++)
{
_networkManager.spawnPrefabs.Add(stressTestEssential[i].Prefab);
}
}
// MIRROR CHANGE: OnGUI instead of Canvas + TextMeshPro
protected override void OnCustomGUI()
{
if (GUILayout.Button("Start Client"))
{
_networkManager.StartClient();
}
if (GUILayout.Button("Start Server"))
{
_networkManager.StartServer();
}
}
// END MIRROR CHANGE
protected override void StressTest(StressTestEssential stressTest)
{
for (int i = 0; i < stressTest.SpawnCount; i++)
{
GameObject go = Instantiate(stressTest.Prefab);
NetworkServer.Spawn(go);
}
}
protected override void UpdateNetworkStats()
{
if (_networkManager == null) return;
if (!_networkManager.isNetworkActive) return;
if (_networkManager.mode == NetworkManagerMode.ServerOnly)
{
_textLatency = ("Latency: 0ms (Server)"); // MIRROR CHANGE: Canvas + TextMeshPro -> OnGUI
return;
}
_textLatency = ($"Latency: {NetworkTime.rtt * 1_000}ms"); // MIRROR CHANGE: Canvas + TextMeshPro -> OnGUI
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 89b59180da8577947a00064507b6f488
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,27 @@
using Mirror;
using StinkySteak.NetcodeBenchmark;
using UnityEngine;
namespace StinkySteak.MirrorBenchmark
{
public class SineMoveRandomBehaviour : NetworkBehaviour
{
[SerializeField] private BehaviourConfig _config;
private SinRandomMoveWrapper _wrapper;
public override void OnStartServer()
{
if (isClient) return;
_config.ApplyConfig(ref _wrapper);
_wrapper.NetworkStart(transform);
}
private void FixedUpdate()
{
if (isClient) return;
_wrapper.NetworkUpdate(transform);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1a33ff1aaf3c582459143cebb4ab7cf9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,27 @@
using Mirror;
using StinkySteak.NetcodeBenchmark;
using UnityEngine;
namespace StinkySteak.MirrorBenchmark
{
public class SineMoveYBehaviour : NetworkBehaviour
{
[SerializeField] private BehaviourConfig _config;
private SinMoveYWrapper _wrapper;
public override void OnStartServer()
{
if (isClient) return;
_config.ApplyConfig(ref _wrapper);
_wrapper.NetworkStart(transform);
}
private void FixedUpdate()
{
if (isClient) return;
_wrapper.NetworkUpdate(transform);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 547d19395b603714c81fc33bfe0f37ca
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,27 @@
using Mirror;
using StinkySteak.NetcodeBenchmark;
using UnityEngine;
namespace StinkySteak.MirrorBenchmark
{
public class WanderMoveBehaviour : NetworkBehaviour
{
[SerializeField] private BehaviourConfig _config;
private WanderMoveWrapper _wrapper;
public override void OnStartServer()
{
if (isClient) return;
_config.ApplyConfig(ref _wrapper);
_wrapper.NetworkStart(transform);
}
private void FixedUpdate()
{
if (isClient) return;
_wrapper.NetworkUpdate(transform);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c98d55e9b7394a94d97efd119d590ecf
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 45924815aac5c0b4a8cffc45aada4031
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,28 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Unlit
m_Shader: {fileID: 4800000, guid: 2126a83145dd7bc48959270850637c77, type: 3}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 0
m_EnableInstancingVariants: 1
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs: []
m_Ints: []
m_Floats:
- __dirty: 0
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
m_BuildTextureStacks: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1a4e2bf0f982f8341a79b69aaaadcf24
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,37 @@
Shader "Unlit"
{
Properties
{
_Color("Color", Color) = (1,1,1,1)
[HideInInspector] __dirty( "", Int ) = 1
}
SubShader
{
Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" "IsEmissive" = "true" }
Cull Back
CGPROGRAM
#pragma target 3.0
#pragma surface surf Unlit keepalpha addshadow fullforwardshadows
struct Input
{
half filler;
};
uniform float4 _Color;
inline half4 LightingUnlit( SurfaceOutput s, half3 lightDir, half atten )
{
return half4 ( 0, 0, 0, s.Alpha );
}
void surf( Input i , inout SurfaceOutput o )
{
o.Emission = _Color.rgb;
o.Alpha = 1;
}
ENDCG
}
Fallback "Diffuse"
}

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: a94f61d08bdef7544b7280e244eb54f5
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,10 @@
Steak's Netcode Benchmark from:
https://github.com/StinkySteak/unity-netcode-benchmark/
Results:
https://colorful-flyaway-e2f.notion.site/Netcode-Benchmark-f431976feb014ce48e030786f116e403?pvs=4
=> Copied into Mirror Examples so we can iterate on bandwidth improvements more quickly.
=> Also copied a few dependencies from:
https://github.com/StinkySteak/unity-netcode-benchmark/blob/master/mirror/Packages/manifest.json
=> replaced TextMeshPro with TextMesh

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 7c012b909308747838d0ae38e292f53a
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: