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(); NetAdapterTools.GetNetworkManager(true); NetAdapterTools.CopyPlayerPrefabFromPUNtoOthers(); NetAdapterTools.EnsureNMPlayerPrefabIsLocalAuthority(); NetAdapterTools.EnsureSceneNetLibDependencies(false); needsEditorModePostAwakeCheck = false; }
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); }
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 }