Example #1
0
        //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);
            }
        }
Example #2
0
        void OnGUI()
        {
            if (so == null)
            {
                so = new SerializedObject(this);
            }

            scroll = EditorGUILayout.BeginScrollView(scroll);

            NSTSettings.DrawAllSettingGuis(this, so, true);
            EditorGUILayout.EndScrollView();
        }
Example #3
0
        /// <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);
 }