//public static void EnsureNSTMasterExistsInScene() //{ // if (NSTMaster.Single == null) // NSTMaster.EnsureExistsInScene(NSTMaster.DEFAULT_GO_NAME); //} #if UNITY_EDITOR /// <summary> /// Ensures NSTSettings as well as (NSTMaster/MasterAdapter/NetworkIdentity) exist in the scene. /// </summary> /// <returns></returns> public static void EnsureSceneNetLibDependencies(bool immediate = true) { if (Application.isPlaying) { return; } // If a post-recompile rebuild of dependencies is pending... do it now. TryToAddDependenciesEverywhere(); #if MIRROR || !UNITY_2019_1_OR_NEWER if (MasterNetAdapter.NetLib == NetworkLibrary.UNET) { GetNetworkManager(true); CopyPlayerPrefab(); } #endif //if (NetLibrarySettings.Single.AutoAddNSTMaster) // NSTMaster.EnsureExistsInScene(NSTMaster.DEFAULT_GO_NAME); if (NetLibrarySettings.Single.AutoAddSettings) { NSTSettings.EnsureExistsInScene(NSTSettings.DEFAULT_GO_NAME); } }
void OnGUI() { if (so == null) { so = new SerializedObject(this); } scroll = EditorGUILayout.BeginScrollView(scroll); NSTSettings.DrawAllSettingGuis(this, so, true); EditorGUILayout.EndScrollView(); }
/// <summary> /// Ensures NSTSettings as well as (NSTMaster/MasterAdapter/NetworkIdentity) exist in the scene. /// </summary> /// <returns></returns> public static void EnsureSceneNetLibDependencies(bool immediate = true) { if (Application.isPlaying) { return; } NSTSettings.EnsureExistsInScene(); // If a post-recompile rebuild of dependencies is pending... do it now. TryToAddDependenciesEverywhere(); if (MasterNetAdapter.NetLib == NetworkLibrary.UNET) { GetNetworkManager(true); CopyPlayerPrefab(); } NSTMaster.EnsureExistsInScene(NSTMaster.DEFAULT_GO_NAME); NSTSettings.EnsureExistsInScene(NSTSettings.DEFAULT_GO_NAME); }
public override void OnInspectorGUI() { base.OnInspectorGUI(); EditorGUILayout.HelpBox("This settings gameobject is added to your scene as a convenience an can safely be removed. To stop this from being created, uncheck 'Auto Add Settings' below.", MessageType.None); NSTSettings.DrawAllSettingGuis(target, serializedObject, false); }