private void Update() { if (Application.isPlaying) { return; } if (EditorApplication.isCompiling) { return; } if (!needsEditorModePostAwakeCheck) { return; } //Destroy the existing Master so it can be readded, to ensure it hasn't been messed up by a library change. //NetAdapterTools.RemoveComponentTypeFromScene<NSTMaster>(true); //FindMissingScripts.DestroyMissingComponentOnRoot(FindObjectOfType<MasterNetAdapter>().gameObject); NetAdapterTools.RemoveUnusedNetworkManager(); NetAdapterTools.TryToAddDependenciesEverywhere(); #if MIRROR || !UNITY_2019_1_OR_NEWER NetAdapterTools.GetNetworkManager(true); #endif NetAdapterTools.CopyPlayerPrefabFromPUNtoOthers(); NetAdapterTools.EnsureNMPlayerPrefabIsLocalAuthority(); NetAdapterTools.EnsureSceneNetLibDependencies(false); needsEditorModePostAwakeCheck = false; }
public virtual void OnEnable() { if (lTexture == null) { lTexture = (Texture2D)AssetDatabase.LoadAssetAtPath("Assets/emotitron/_Graphics/HeaderName/NST " + headerName + ".png", typeof(Texture2D)); } if (rTexture == null) { rTexture = (Texture2D)AssetDatabase.LoadAssetAtPath("Assets/emotitron/_Graphics/NST Teapot.png", typeof(Texture2D)); } if (bTexture == null) { bTexture = (Texture2D)AssetDatabase.LoadAssetAtPath("Assets/emotitron/_Graphics/Background/NST " + headerColor + ".png", typeof(Texture2D)); } #if UNITY_EDITOR // Touching or adding any Component that is part of the NST Library will fire this. NetAdapterTools.EnsureSceneNetLibDependencies(false); #endif Undo.undoRedoPerformed -= OnUndoRedo; Undo.undoRedoPerformed += OnUndoRedo; }
public virtual void OnEnable() { //if (lTexture == null) // lTexture = (Texture2D)AssetDatabase.LoadAssetAtPath("Assets/emotitron/_Graphics/HeaderName/NST " + headerName + ".png", typeof(Texture2D)); //if (rTexture == null) // rTexture = (Texture2D)AssetDatabase.LoadAssetAtPath("Assets/emotitron/_Graphics/NST Teapot.png", typeof(Texture2D)); //if (bTexture == null) // bTexture = (Texture2D)AssetDatabase.LoadAssetAtPath("Assets/emotitron/_Graphics/Background/NST " + headerColor + ".png", typeof(Texture2D)); if (lTexture == null) lTexture = (Texture2D)Resources.Load<Texture2D>("_Graphics/HeaderName/NST " + headerName); if (rTexture == null) rTexture = (Texture2D)Resources.Load<Texture2D>("_Graphics/NST Teapot"); if (bTexture == null) bTexture = (Texture2D)Resources.Load<Texture2D>("_Graphics/Background/NST " + headerColor); // Touching or adding any Component that is part of the NST Library will fire this. NetAdapterTools.EnsureSceneNetLibDependencies(false); Undo.undoRedoPerformed -= OnUndoRedo; Undo.undoRedoPerformed += OnUndoRedo; }
public override void OnEnable() { headerName = HeaderSettingsName; headerColor = HeaderSettingsColor; base.OnEnable(); NetAdapterTools.TryToAddDependenciesEverywhere(); NetAdapterTools.EnsureSceneNetLibDependencies(true); }
public override void OnInspectorGUI() { serializedObject.Update(); MasterNetAdapter _target = (MasterNetAdapter)target; NetAdapterTools.EnsureSceneNetLibDependencies(); base.OnInspectorGUI(); EditorGUILayout.HelpBox("This is the UNET adapter. To work with Photon PUN, switch the Network Library.", MessageType.None); NetLibrarySettings.Single.DrawGui(true, false); }