Ejemplo n.º 1
0
 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>());
     }
 }
Ejemplo n.º 2
0
    //Runtime functions

    private void Start()
    {
        rb               = GetComponent <Rigidbody2D>();
        proton           = GameObject.Find("Proton Sprite");
        protonOrbit      = proton.GetComponent <ProtonOrbit>();
        superpositioners = GameObject.FindGameObjectsWithTag("Superpositioner");
        numberOfJumpsL   = 0;
        numberOfJumpsR   = 0;
        for (int i = 0; i < superpositioners.Length; i++)
        {
            superpositionerScripts.Add(superpositioners[i].GetComponent <Superpositioner>());
        }
    }
Ejemplo n.º 3
0
 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>();
 }