Force avatarshop avatars prefabs to avatarshop assetbundle
This commit is contained in:
		
							parent
							
								
									1e0e10670e
								
							
						
					
					
						commit
						48b60e7ef3
					
				@ -23,7 +23,7 @@ namespace Passer {
 | 
			
		||||
            possession = (Possessable)target;
 | 
			
		||||
 | 
			
		||||
            DeterminePossessionType();
 | 
			
		||||
            //AddToAssetBundle();
 | 
			
		||||
            AddToAssetBundle();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private void DeterminePossessionType() {
 | 
			
		||||
@ -42,13 +42,16 @@ namespace Passer {
 | 
			
		||||
            Scene activeScene = UnityEngine.SceneManagement.SceneManager.GetActiveScene();
 | 
			
		||||
 | 
			
		||||
            if (IsPrefab(possession.gameObject)) {
 | 
			
		||||
                Debug.Log("is prefab");
 | 
			
		||||
                //Debug.Log("is prefab");
 | 
			
		||||
                possession.assetPath = AssetDatabase.GetAssetPath(possession.gameObject);
 | 
			
		||||
 | 
			
		||||
                string scenePath = activeScene.path;
 | 
			
		||||
                AssetImporter assetImporter = AssetImporter.GetAtPath(possession.assetPath);
 | 
			
		||||
                if (assetImporter != null)
 | 
			
		||||
                    assetImporter.assetBundleName = "possessions"; //activeScene.name + "_possessions";
 | 
			
		||||
                    // HACK: force avatars to avatarhops because we cannot change assetbundle in package prefabs
 | 
			
		||||
                    assetImporter.assetBundleName = "avatarshop"; // "possessions"; //activeScene.name + "_possessions";
 | 
			
		||||
 | 
			
		||||
                //Debug.Log(possession.gameObject + ": Set AssetBundleName to " + assetImporter.assetBundleName);
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
@ -58,7 +61,8 @@ namespace Passer {
 | 
			
		||||
 | 
			
		||||
                string scenePath = activeScene.path;
 | 
			
		||||
                AssetImporter assetImporter = AssetImporter.GetAtPath(possession.assetPath);
 | 
			
		||||
                assetImporter.assetBundleName = "possessions"; //activeScene.name + "_possessions";
 | 
			
		||||
                // HACK: force avatars to avatarhops because we cannot change assetbundle in package prefabs
 | 
			
		||||
                assetImporter.assetBundleName = "avatarshop"; //"possessions"; //activeScene.name + "_possessions";
 | 
			
		||||
                //Debug.Log(possession.gameObject + ": Set AssetBundleName to " + assetImporter.assetBundleName);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -3,5 +3,5 @@ guid: 6d76b63d1c2ee4f4995b2109dc16402f
 | 
			
		||||
PrefabImporter:
 | 
			
		||||
  externalObjects: {}
 | 
			
		||||
  userData: 
 | 
			
		||||
  assetBundleName: possessions
 | 
			
		||||
  assetBundleName: avatarshop
 | 
			
		||||
  assetBundleVariant: 
 | 
			
		||||
 | 
			
		||||
@ -3,5 +3,5 @@ guid: 4a108532c0ba23c4796003a7390c1ae9
 | 
			
		||||
PrefabImporter:
 | 
			
		||||
  externalObjects: {}
 | 
			
		||||
  userData: 
 | 
			
		||||
  assetBundleName: possessions
 | 
			
		||||
  assetBundleName: avatarshop
 | 
			
		||||
  assetBundleVariant: 
 | 
			
		||||
 | 
			
		||||
@ -3,5 +3,5 @@ guid: f558cc7556c4ffc4594edb212b1cd0dc
 | 
			
		||||
PrefabImporter:
 | 
			
		||||
  externalObjects: {}
 | 
			
		||||
  userData: 
 | 
			
		||||
  assetBundleName: possessions
 | 
			
		||||
  assetBundleName: avatarshop
 | 
			
		||||
  assetBundleVariant: 
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user