List scripts = GetScriptsInFolder( "Assets ") ĮditorUtility. Output( "Replaced " + converted2 + " NetworkViews with PhotonViews in scene: " + sceneName) Hierarch圜hange() //TODO: most likely this is triggered on change or on save This will correct all prefabs: The prefabs have gotten new components, but the correct ID's were lost in this case FindObjectsOfType( typeof( NetworkView)), true) Int converted2 = ConvertNetworkView(( NetworkView) GameObject. AllDirectories) įoreach ( string sceneName in sceneFiles)ĮditorSceneManager. GetFiles( "Assets/ ", "*.unity ", SearchOption. Convert NetworkViews to PhotonViews in scenes Output( "Fixed prefab by moving it into a resources folder. Substring( 0, lastSlash) + "/Resources/ " This prefab NEEDS to be placed under a resources folder ![]() But has been placed in the root of another one! ") ![]() LogWarning( "Warning, prefab was already in a resources folder. This prefab needs to be under the root of a Resources folder! GetType() = typeof( GameObject))Ĭonverted += ConvertNetworkView((( GameObject) obj). GetFiles( "Assets/ ", "*.prefab ", SearchOption. DisplayDialog( "Conversion ", "Can all prefabs that use a PhotonView be moved to a Resources/ folder? You need this if you use Network.Instantiate. Ask the user if we can move all prefabs to a resources folderīool movePrefabs = EditorUtility. Convert NetworkViews to PhotonViews in Project prefabs SaveCurrentModifiedScenesIfUserWantsTo() ĮditorUtility. ![]() timeSinceStartup + " Started conversion of Unity networking -> Photon ") ĮditorSceneManager. A backup is therefore strongly recommended! ", "Yes, I've made a backup: GO ", "Abort ") DisplayDialog( "Conversion ", "Disclaimer: The code conversion feature is quite crude, but should do it's job well (see the sourcecode). DisplayDialogComplex( "Conversion ", "Attempt automatic conversion from Unity Networking to Photon Unity Networking \"PUN \"? ", "Yes ", "No! ", "Pick Script Folder ") īool result = EditorUtility. Script to convert a Unity Networking project to PhotonNetwork. PhotonNetwork Framework for Unity - Copyright (C) 2011 Exit Games GmbH
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |