Hi All - I have a use case where in I need to maintain the list of gameobjects , its state and control gameobjects accordingly. To keep it simple, below I have given some simple example which is almost similar to what I am trying to achieve.
Assume we have set of gameobjects like wire,battery,bulb,switch etc now If I drag and drop 2 wires next to each other then connect battery again a wire then switch and then bulb. Now for me to control bulb switch off and on in my player controller script I should know what is attached to left and right side of every gameobject.
Based on this scenario
1) What is the best way to make gameobjects attract another gameobject when it is brought nearer to it.
Not sure using colliders is the best way or if we have any other better way of doing this.
2) How to store what is attached to left and right side of each gameobject. Probably may have to use linked list or binary tree but wanted to check if there is any other way of achieving this in Unity,
↧