c# - How to know image is used in which prefab -
how know image used in prefabs? in project (modified project on ray wenderlich) below, have image named cat.png
. use in myprefab.prefab
. suppose i'm not project creator, how can find out prefab each image came from?
this has been answered before. can find using code. put code below in start()
function , click play stop. show prefab gameobject/cat picture belongs to.
void start() { gameobject prefab = gameobject.find("cat"); object gameobject2 = unityeditor.prefabutility.getprefabparent(prefab); string prefabpath = unityeditor.assetdatabase.getassetpath(gameobject2); debug.log("path: " + prefabpath); }
or without code:
select object/cat hierarchy on inspector on right, click select
, prefab name displayed , selected in project tab.
Comments
Post a Comment