mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-21 18:40:03 +00:00
dont add networkbehaviours dynamically
This commit is contained in:
parent
a09ee8ac99
commit
1edeaf2e2a
@ -295,7 +295,7 @@ namespace Mirror
|
|||||||
// NetworkBehaviour components are initialized in Awake once.
|
// NetworkBehaviour components are initialized in Awake once.
|
||||||
// Changing them at runtime would get client & server out of sync.
|
// Changing them at runtime would get client & server out of sync.
|
||||||
// BUT internal so tests can add them after creating the NetworkIdentity
|
// BUT internal so tests can add them after creating the NetworkIdentity
|
||||||
public void InitializeNetworkBehaviours()
|
internal void InitializeNetworkBehaviours()
|
||||||
{
|
{
|
||||||
// Get all NetworkBehaviours
|
// Get all NetworkBehaviours
|
||||||
// (never null. GetComponents returns [] if none found)
|
// (never null. GetComponents returns [] if none found)
|
||||||
|
@ -34,12 +34,8 @@ namespace QSB.Animation.Player
|
|||||||
|
|
||||||
protected void Awake()
|
protected void Awake()
|
||||||
{
|
{
|
||||||
InvisibleAnimator = gameObject.AddComponent<Animator>();
|
InvisibleAnimator = gameObject.GetRequiredComponent<Animator>();
|
||||||
gameObject.SetActive(false);
|
NetworkAnimator = gameObject.GetRequiredComponent<NetworkAnimator>();
|
||||||
NetworkAnimator = gameObject.AddComponent<NetworkAnimator>();
|
|
||||||
NetworkAnimator.animator = InvisibleAnimator;
|
|
||||||
gameObject.SetActive(true);
|
|
||||||
netIdentity.InitializeNetworkBehaviours();
|
|
||||||
NetworkAnimator.enabled = false;
|
NetworkAnimator.enabled = false;
|
||||||
|
|
||||||
QSBSceneManager.OnUniverseSceneLoaded += OnUniverseSceneLoaded;
|
QSBSceneManager.OnUniverseSceneLoaded += OnUniverseSceneLoaded;
|
||||||
|
Binary file not shown.
@ -1,18 +1,22 @@
|
|||||||
ManifestFileVersion: 0
|
ManifestFileVersion: 0
|
||||||
CRC: 3050150252
|
CRC: 904672015
|
||||||
Hashes:
|
Hashes:
|
||||||
AssetFileHash:
|
AssetFileHash:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
Hash: e3779728ade70a83cb691ff38a942b27
|
Hash: 0b4be2b85e27e674ee1f3e4b49f62e9c
|
||||||
TypeTreeHash:
|
TypeTreeHash:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
Hash: 685965bc8b6c3e44c52353fb71b334e8
|
Hash: 14984479d6126808e669db352f4ec761
|
||||||
HashAppended: 0
|
HashAppended: 0
|
||||||
ClassTypes:
|
ClassTypes:
|
||||||
- Class: 1
|
- Class: 1
|
||||||
Script: {instanceID: 0}
|
Script: {instanceID: 0}
|
||||||
- Class: 4
|
- Class: 4
|
||||||
Script: {instanceID: 0}
|
Script: {instanceID: 0}
|
||||||
|
- Class: 95
|
||||||
|
Script: {instanceID: 0}
|
||||||
|
- Class: 114
|
||||||
|
Script: {fileID: 1077175584, guid: b782d36837e164d4e87858bf8f2736c6, type: 3}
|
||||||
- Class: 114
|
- Class: 114
|
||||||
Script: {fileID: 860895539, guid: b782d36837e164d4e87858bf8f2736c6, type: 3}
|
Script: {fileID: 860895539, guid: b782d36837e164d4e87858bf8f2736c6, type: 3}
|
||||||
- Class: 114
|
- Class: 114
|
||||||
@ -29,6 +33,8 @@ ClassTypes:
|
|||||||
Script: {fileID: 78926581, guid: 27687deae413b90448366870cb0de502, type: 3}
|
Script: {fileID: 78926581, guid: 27687deae413b90448366870cb0de502, type: 3}
|
||||||
- Class: 114
|
- Class: 114
|
||||||
Script: {fileID: -749020886, guid: 27687deae413b90448366870cb0de502, type: 3}
|
Script: {fileID: -749020886, guid: 27687deae413b90448366870cb0de502, type: 3}
|
||||||
|
- Class: 114
|
||||||
|
Script: {fileID: -270813150, guid: 27687deae413b90448366870cb0de502, type: 3}
|
||||||
- Class: 114
|
- Class: 114
|
||||||
Script: {fileID: -1617191155, guid: 27687deae413b90448366870cb0de502, type: 3}
|
Script: {fileID: -1617191155, guid: 27687deae413b90448366870cb0de502, type: 3}
|
||||||
- Class: 114
|
- Class: 114
|
||||||
|
@ -114,8 +114,7 @@ namespace QSB.TimeSync
|
|||||||
{
|
{
|
||||||
new RequestStateResyncMessage().Send();
|
new RequestStateResyncMessage().Send();
|
||||||
CurrentState = State.Loaded;
|
CurrentState = State.Loaded;
|
||||||
gameObject.GetAddComponent<PreserveTimeScale>();
|
gameObject.GetRequiredComponent<PreserveTimeScale>();
|
||||||
netIdentity.InitializeNetworkBehaviours();
|
|
||||||
if (isServer)
|
if (isServer)
|
||||||
{
|
{
|
||||||
SendServerTime();
|
SendServerTime();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user