Question by
$$anonymous$$ · Apr 11, 2017 at 03:52 PM ·
c#unity 5
How can I compare different GameObjects located on differents Asset Bundles?
Code:
public List<GameObject> A01A = new List<GameObject>();//24 gameobjects
public List<GameObject> A01B = new List<GameObject>();//35 gameobjects
public List<List<GameObject>> Lista = new List<List<GameObject>> ();
void Start () {
A01A.AddRange (GameObject.FindGameObjectsWithTag ("A01A"));
A01B.AddRange (GameObject.FindGameObjectsWithTag ("A01B"));
Lista.Add (A01A);
Lista.Add (A01B);
}
void Update () {
if (Input.GetKeyDown (KeyCode.Q)) {
for(int i = 0; i < Lista.Count; i++){
for(int j = 0; j < Lista[i].Count; j++){
if(Lista[0][j].name.Contains("RCQUIAa")){
//4 GameObjects
}
if (Lista [1] [j].name.Contains ("RCQUIAa")) {
//5 GameObjects
}
}
}
}
I want to compare if the gameobjects have the same ID(RCQUIAa) and then know if the gameobjects have the same position.
Any ideas¿?
Also the code must work with a lot of lists and gameobjects.
Comment
Your answer

Follow this Question
Related Questions
it's like my Button tries to go interractable = false; but can't do it //any help? 0 Answers
Trouble with virtual and protected 2 Answers
C# Unity dot syntax exercise correct solution? 1 Answer
FPS Character Controller HELP with head bob and camera! 2 Answers
Jumping while hugging a tiled wall decreases jump height 0 Answers