private void Awake() { currentTime = 3; electron.AssignGameObjects(); textUI = countdownText.GetComponent <TextMeshProUGUI>(); electronProperties = electron.electron.GetComponent <PlayerMovement>(); slider.value = slider.maxValue; uiScript = Pause.GetComponent <UImanager>(); proton = GameObject.FindGameObjectWithTag("Proton"); antiprotons = GameObject.FindGameObjectsWithTag("Antiproton"); superpositions = GameObject.FindGameObjectsWithTag("Superpositioner"); quantumEnergys = GameObject.FindGameObjectsWithTag("Bonus"); protonScript = proton.GetComponent <ProtonOrbit>(); for (int i = 0; i < superpositions.Length; i++) { superpositioners.Add(superpositions[i].GetComponent <Superpositioner>()); } for (int i = 0; i < quantumEnergys.Length; i++) { energyAdders.Add(quantumEnergys[i].GetComponent <EnergyAdder>()); } for (int i = 0; i < antiprotons.Length; i++) { antiprotonScripts.Add(antiprotons[i].GetComponent <AntiProton>()); } }
private void Start() { Pause = GameObject.Find("UI Manager"); electron.AssignGameObjects(); if (electron.positrons.Length > 0) { positronTmpY = electron.positrons[currentPositron].transform.position.y; } electronRB = electron.electron.GetComponent <Rigidbody2D>(); uiScript = Pause.GetComponent <UImanager>(); col2D = GetComponent <Collider2D>(); }
void Start() { electron.AssignGameObjects(); if (gameObject.name.Length >= 10) { currentPositron = gameObject.name[10] - '0'; } else { currentPositron = 0; } temporaryY = gameObject.transform.position.y; antielectronRB = electron.positrons[currentPositron].GetComponent <Rigidbody2D>(); electronRB = electron.electron.GetComponent <Rigidbody2D>(); orbitScript = proton.GetComponentInChildren <ProtonOrbit>(); }