Replace the references to an asset?,How can I replace all the references of an asset to another asset?
I found the references to the object in the form of path with AssetDatabase.GetDependencies(), now is there a way to point the corresponding reference to another asset in a different path?
For example, if I have asset A, B, C, D all referencing to E, is there a way to replace the corresponding reference of E to F instead?
I have searched online and through the APIs and did not found a good solution, open the files as text and replace the guid is not good enough as some of the assets are not in the form of text.
How does AssetDatabase generates the dependencies anyways? Is there a way to read and write dependencies like the AssetDatabase does?,I am able to find all the references in terms of asset path to an asset. But is there a way to replace them?
For example, if I have asset A1, A2, ... AN all referencing to B, is there a way to safely make their corresponding reference point to C instead?
Would it work if I just do a text search among the files and replace the guid? Probably not because not all the assets are in the form of text.
Is there a way to replace them? Or do I have to figure a way for each asset type what so ever? How does the AssetDatabase determines such reference and returns them with GetDependencies?
Your answer
Follow this Question
Related Questions
How can I get a sub asset? 1 Answer
What is the trick with VS projects references? 0 Answers
AssetDatabase.LoadAssetAtPath Not finding assets 0 Answers
How to open files in the game's StreamingAssets folder of game on steam ? 0 Answers
Warning This Unity Package has Package Manager dependencies - do I skip or install/upgrade? 1 Answer