Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: nFighter on August 08, 2018, 10:15:39 AM
-
Hey! It looks like a very common task, but i'm not sure how to do it right.
I have some objects in a /Assets/Resource folder. All objects have Array List proxy with data. How should I found the certain object by name and read data from it?
Is there something like Find Game Object, but for searching in the project, not the scene?
-
Hi.
I don't think that it is possible to find the game object if it is not in the scene.
But a way you could do this is to have an array with the prefab names, and then instantiate the object.
Do these object only have an array list component or do they have more components?
If only the array list, then it is maybe better to have them in your scene and you can enable/disable them if needed.
-
Actually, it's possible with the Unity's Resource management (https://docs.unity3d.com/ScriptReference/Resources.html?_ga=2.86138776.1659754502.1533661516-689402192.1516339569), but maybe it's not a best way ;D
Actually, it's a "kind of" inventory implementation. It's an icons objects with simple scripts and array lists with details. And for now I'm doing exactly as you say - just keep them all in scene.