コード例 #1
0
 // Start is called before the first frame update
 void Start()
 {
     //Como desde el prefab no podemos arrastrar el GameObject, lo buscamos en la escena
     SpaceShip = GameObject.Find("Spaceship");
     //Asociamos a la variable el componente de la nave (es decir su script)
     spaceshipMove = SpaceShip.GetComponent <SpaceshipMove>();
 }
コード例 #2
0
ファイル: ObstacleMove.cs プロジェクト: mariulxd/Bugs-Zaxxon
 // Start is called before the first frame update
 void Start()
 {
     SpaceShip     = GameObject.Find("StarSparrow1");
     spaceshipMove = SpaceShip.GetComponent <SpaceshipMove>();
     initObject    = GameObject.Find("InitObject");
     initGame      = initObject.GetComponent <InitGame>();
     obstacleSpeed = initGame.speed;
 }
コード例 #3
0
    // Start is called before the first frame update
    void Start()
    {
        //Accedo al script de la nave
        spaceshipMove = Nave.GetComponent<SpaceshipMove>();



        //Lanzo la corrutina
        StartCoroutine("InstanciadorEsferas");
    }
コード例 #4
0
    // Start is called before the first frame update
    void Start()
    {
        //asignamos el componente render
        rend = GetComponent <Renderer>();

        //obtener el script
        GameObject InitEmpty = GameObject.Find("Spaceship");

        initgame = InitEmpty.GetComponent <SpaceshipMove>();
    }
コード例 #5
0
ファイル: MoverBala.cs プロジェクト: mariulxd/Bugs-Zaxxon
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "obstacle")
     {
         Nave      = GameObject.Find("StarSparrow1");
         spaceship = Nave.GetComponent <SpaceshipMove>();
         spaceship.Contador++;
         Destroy(gameObject);
         Destroy(other.gameObject);
     }
 }
コード例 #6
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "obstacle")
     {
         muerto    = true;
         Nave      = GameObject.Find("StarSparrow1");
         spaceship = Nave.GetComponent <SpaceshipMove>();
         spaceship.StopCoroutine("Tiempojuego");
         myMesh.enabled = false;
         pos            = transform.position;
         audioSourceExp = GetComponent <AudioSource>();
         audioSourceExp.PlayOneShot(explosion, 0.2F);
         ObstacleMove.obstacleSpeed = 0;
         Instantiate(ExplosionParticulas, pos, Quaternion.identity);
         Invoke("CambiarEscena", 1.5f);
     }
 }
コード例 #7
0
    // Start is called before the first frame update
    void Start()
    {
        //Distancia inical 25 columnas
        for (int n = 1; n < 25; n++)
        {
            randomNumber = Random.Range(-7f, 6f);
            Vector3 RandomPos = InitPos.position + new Vector3(randomNumber, 0, n * -5);
            Instantiate(Columna, RandomPos, Quaternion.identity);
        }

        //Accedo al script de la nave
        spaceshipMove = Nave.GetComponent <SpaceshipMove>();



        //Lanzo la corrutina
        StartCoroutine("InstanciadorColumnas");
    }