Example #1
0
 // Update is called once per frame
 void Update()
 {
     time += Time.deltaTime;
     if (time >= 1.5f)
     {
         time -= 1.5f;
         int          pos = Random.Range(0, SpawnPoints.Length - 1);
         SphereGizmos sG  = SpawnPoints[pos].GetComponent <SphereGizmos>();
         if (!sG.isInstantiated() && !SpawnPoints[pos].GetComponent <SpawnPrevention>().isSomeoneThere())
         {
             sG.is_instanced(true);
             GameObject c = (GameObject)Instantiate(Clock, SpawnPoints[pos].position, SpawnPoints[pos].rotation);
             c.transform.parent = transform;
             ClockGestor rC = c.GetComponent <ClockGestor>();
             rC.setSpawner(SpawnPoints[pos]);
         }
     }
 }
Example #2
0
 // Update is called once per frame
 void Update()
 {
     time += Time.deltaTime;
     if (time >= spawnTime)
     {
         time = 0;
         int          pos     = Random.Range(0, PowerUps.Length - 1);
         int          spawner = Random.Range(0, SpawnPoints.Length - 1);
         SphereGizmos sG      = SpawnPoints[spawner].GetComponent <SphereGizmos>();
         if (!sG.isInstantiated() && !SpawnPoints[pos].GetComponent <SpawnPrevention>().isSomeoneThere())
         {
             sG.is_instanced(true);
             if (pos < 3)
             {
                 GameObject c = (GameObject)Instantiate(PowerUpType1, SpawnPoints[pos].position, SpawnPoints[pos].rotation);
                 //Physics.IgnoreCollision(SpawnPoints[pos].collider, c.collider);
                 c.transform.parent = SpawnPoints[pos];
                 c.transform.GetChild(0).renderer.material.mainTexture = PowerUps[pos];
                 c.transform.GetChild(1).renderer.material.mainTexture = PowerUps[pos];
                 ClockGestor     rC  = c.GetComponent <ClockGestor>();
                 SimpleIDHandler iDH = c.GetComponent <SimpleIDHandler>();
                 iDH.setID(pos);
                 //Debug.Log(iDH.getID ());
                 rC.setSpawner(SpawnPoints[pos]);
             }
             else
             {
                 GameObject c = (GameObject)Instantiate(PowerUpType2, SpawnPoints[pos].position, SpawnPoints[pos].rotation);
                 //Physics.IgnoreCollision(SpawnPoints[pos].collider, c.collider);
                 c.transform.parent = SpawnPoints[pos];
                 c.transform.parent = transform;
                 c.transform.GetChild(0).renderer.material.mainTexture = PowerUps[pos];
                 c.transform.GetChild(1).renderer.material.mainTexture = PowerUps[pos];
                 ClockGestor     rC  = c.GetComponent <ClockGestor>();
                 SimpleIDHandler iDH = c.GetComponent <SimpleIDHandler>();
                 iDH.setID(pos);
                 //Debug.Log(iDH.getID ());
                 rC.setSpawner(SpawnPoints[pos]);
             }
         }
     }
 }
Example #3
0
    void OnDestroy()
    {
        SphereGizmos sG = spawner.GetComponent <SphereGizmos>();

        sG.is_instanced(false);
    }