// int triggersSince = 0; // Use this for initialization void Start() { startOrig = 0; endOrig = 360; bubCtr = GameObject.Find("BubbleC"); bubCtrScript = (masterBubble)bubCtr.GetComponent(typeof(masterBubble)); bubCtrPos = bubCtr.transform.position; toggleCount = 0; current = 0; foreach (GameObject gameObj in GameObject.FindObjectsOfType <GameObject>()) { // print(gameObj.name.Substring(0, 10)); if ((gameObj.name.Length >= 10) && (gameObj.name.Substring(0, 10) == "BubbleAuto")) { bubbles.Add(gameObj); } } for (int i = 0; i < bubbles.Count; i++) { GameObject temp = bubbles[i]; int randomIndex = Random.Range(i, bubbles.Count); bubbles[i] = bubbles[randomIndex]; bubbles[randomIndex] = temp; } pickOpp(); done = false; }
void pickOpp() { bubOpp = bubbles [current]; //bubbles[Random.Range(0, bubbles.Count)]; bubOppScript = (masterBubble)bubOpp.GetComponent(typeof(masterBubble)); bubOppOrigPos = bubOpp.transform.position; current += 1; }