playMaker

Author Topic: Find&reference objects in project, not in scene.  (Read 1314 times)

nFighter

  • Beta Group
  • Full Member
  • *
  • Posts: 174
    • multiplayer adult fighting
Find&reference objects in project, not in scene.
« 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?
indie developer of multiplayer adult fighting
http://nakedfighter3d.com

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Find&reference objects in project, not in scene.
« Reply #1 on: August 08, 2018, 10:02:45 PM »
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.

nFighter

  • Beta Group
  • Full Member
  • *
  • Posts: 174
    • multiplayer adult fighting
Re: Find&reference objects in project, not in scene.
« Reply #2 on: August 09, 2018, 11:25:24 AM »
Actually, it's possible with the Unity's Resource management, 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.
indie developer of multiplayer adult fighting
http://nakedfighter3d.com