Fix loading wrong Possession
This commit is contained in:
		
							parent
							
								
									7d41944b98
								
							
						
					
					
						commit
						075a5d7ba1
					
				| @ -156,16 +156,20 @@ namespace Passer.Humanoid { | ||||
| 
 | ||||
|                 if (humanoid.remoteAvatar == null) { | ||||
|                     Possessable avatarPossessable = humanoid.avatarRig.GetComponent<Possessable>(); | ||||
|                     if (avatarPossessable != null) | ||||
|                     if (avatarPossessable != null) { | ||||
|                         possessionLocation = avatarPossessable.siteLocation; | ||||
| 
 | ||||
|                         avatarPrefabName = avatarPossessable.assetPath; | ||||
|                     } | ||||
|                     else | ||||
|                         avatarPrefabName = humanoid.avatarRig.name; // .Substring(0, humanoid.avatarRig.name.Length - 7);  | ||||
|                 } | ||||
|                 else { | ||||
|                     Possessable avatarPossessable = humanoid.remoteAvatar.GetComponent<Possessable>(); | ||||
|                     if (avatarPossessable != null) | ||||
|                     if (avatarPossessable != null) { | ||||
|                         possessionLocation = avatarPossessable.siteLocation; | ||||
| 
 | ||||
|                         avatarPrefabName = avatarPossessable.assetPath; | ||||
|                     } | ||||
|                     else | ||||
|                         avatarPrefabName = humanoid.remoteAvatar.name; | ||||
|                 } | ||||
| 
 | ||||
|  | ||||
| @ -67,7 +67,7 @@ namespace Passer { | ||||
|         } | ||||
| 
 | ||||
|         private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { | ||||
|             if (_siteLocation == null) | ||||
|             if (string.IsNullOrEmpty(_siteLocation)) | ||||
|                 DetermineSiteLocation(); | ||||
|         } | ||||
| 
 | ||||
|  | ||||
| @ -316,10 +316,12 @@ namespace Passer { | ||||
|                     if (lastSlashIx >= 0) | ||||
|                         possessableName = possessablePath.Substring(+1); | ||||
| 
 | ||||
|                     Debug.Log("Load: " + possessablePath); | ||||
|                     possessableName = possessableName.ToLower(); | ||||
| 
 | ||||
|                     Debug.Log("Load: " + possessableName); | ||||
|                     prefab = assetBundle.LoadAsset<GameObject>(possessableName); | ||||
|                     if (prefab == null) { | ||||
|                         Debug.LogError("Could not load " + possessablePath); | ||||
|                         Debug.LogError("Could not load " + possessableName); | ||||
|                         yield break; | ||||
|                     } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user