Quantcast
Channel: Answers for "Determine if an external prefab exists within the project 's assets folder (not in scene)"
Browsing all 4 articles
Browse latest View live

Answer by Chris Masterton

If you know the name of the prefab you could try GameObject.Find. A return value of null would mean it is not loaded.GameObject myPrefab = GameObject.Find("nameOfMyPrefab"); if( myPrefab == null ) { //...

View Article



Answer by LeMoine

Ok, I found the solution here: [How to "Get" prefabs from project View by code][1] To check if a prefab is in the assets, use the `Resources.Load("prefabName")` method, like this: Object prefab; try{...

View Article

Answer by Chris Masterton

If you know the name of the prefab you could try GameObject.Find. A return value of null would mean it is not loaded.GameObject myPrefab = GameObject.Find("nameOfMyPrefab"); if( myPrefab == null ) { //...

View Article

Answer by LeMoine

Ok, I found the solution here: [How to "Get" prefabs from project View by code][1] To check if a prefab is in the assets, use the `Resources.Load("prefabName")` method, like this: Object prefab; try{...

View Article
Browsing all 4 articles
Browse latest View live




Latest Images