mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
NetworkIdentity.OnValidate: wrap in #if UNITY_EDITOR in case OnValidate is needed at runtime later
This commit is contained in:
parent
8eb27ea0af
commit
ed64872163
@ -147,9 +147,9 @@ internal void RemoveObserverInternal(NetworkConnection conn)
|
|||||||
observers?.Remove(conn.connectionId);
|
observers?.Remove(conn.connectionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if UNITY_EDITOR
|
|
||||||
void OnValidate()
|
void OnValidate()
|
||||||
{
|
{
|
||||||
|
#if UNITY_EDITOR
|
||||||
if (m_ServerOnly && m_LocalPlayerAuthority)
|
if (m_ServerOnly && m_LocalPlayerAuthority)
|
||||||
{
|
{
|
||||||
Debug.LogWarning("Disabling Local Player Authority for " + gameObject + " because it is server-only.");
|
Debug.LogWarning("Disabling Local Player Authority for " + gameObject + " because it is server-only.");
|
||||||
@ -157,8 +157,10 @@ void OnValidate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
SetupIDs();
|
SetupIDs();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
void AssignAssetID(GameObject prefab) => AssignAssetID(AssetDatabase.GetAssetPath(prefab));
|
void AssignAssetID(GameObject prefab) => AssignAssetID(AssetDatabase.GetAssetPath(prefab));
|
||||||
void AssignAssetID(string path) => m_AssetId = AssetDatabase.AssetPathToGUID(path);
|
void AssignAssetID(string path) => m_AssetId = AssetDatabase.AssetPathToGUID(path);
|
||||||
bool ThisIsAPrefab() => PrefabUtility.IsPartOfPrefabAsset(gameObject);
|
bool ThisIsAPrefab() => PrefabUtility.IsPartOfPrefabAsset(gameObject);
|
||||||
|
Loading…
Reference in New Issue
Block a user