Example #1
0
 // Use this for initialization
 void Start()
 {
     if (game)
     {
         controlador      = ControlJuego.Jugando;
         textUsuario.text = PlayerPrefs.GetString("Usuario");
     }
     StartCoroutine(meteorito());
 }
Example #2
0
    void Start()
    {
        controlJuego = ControlJuego.instance;

        // Obtenemos el componente de audio y renderer
        audioSource = GetComponent<AudioSource>();
        renderizador = GetComponent<Renderer>();

        valorBloque = ((int)tipo + 1) * 10;
    }
Example #3
0
    // Start is called before the first frame update
    void Start()
    {
        rbObjetivo = GetComponent <Rigidbody>();


        transform.position = PosGenerator();

        rbObjetivo.AddForce(ImpulseForce(), ForceMode.Impulse);

        rbObjetivo.AddTorque(ValorTorsion(), ValorTorsion(), ValorTorsion(), ForceMode.Impulse);

        controlJuego = GameObject.Find("GestorJuego").GetComponent <ControlJuego>();
    }
    private void OnMouseUp()
    {
        _audioManager.PlayClickedSound();
        switch (gameObject.name)
        {
        case "Play":
            Options.Items2.SetActive(true);
            Options.Items1.SetActive(false);
            SaveEstateManager.LoadState();
            break;

        case "Nuevo Juego":
            ControlJuego.Reset();
            newGame = true;
            SceneManager.LoadScene("MapaPrincipal");
            break;

        case "Continuar":
            SaveEstateManager.LoadState();
            SceneManager.LoadScene("MapaPrincipal");
            break;

        case "Options":
            Options.Items2.SetActive(false);
            Options.Items1.SetActive(false);
            Options.showCanvas(true);
            break;

        case "Credits":
            SceneManager.LoadScene("Credits");
            break;

        case "Volver":
            Options.Items2.SetActive(false);
            Options.Items1.SetActive(true);
            break;

        case "Quit":
            Application.Quit(0);
            break;
        }
        gameObject.transform.localScale /= SCALEFACTOR;
    }
Example #5
0
    private Vector2 posPortalInstanciacion; //Posicion del portal de instanciacion del personaje

    //------------------------------------------------------------------------------------------------------------------

    /*
     * METODO QUE SE EJECUTA AL INICIO DE LA EJECUCIÓN PARA REALIZAR REFERENCIAS
     */
    private void Awake()
    {
        //Iniciar variables
        contEnergia         = 0;
        vidaAux             = vida;
        iniciarCargaEnergia = true;

        //Obtener referencias
        pView        = GetComponent <PhotonView>();
        controlJuego = GameObject.Find("ControladorJuego").GetComponent <ControlJuego>();
        //controlJuego.establecerMarcadores();

        gestionPlantas = GameObject.Find("ControladorJuego").GetComponent <GestionPlantas>();

        //Obtener referencia elemento interfaz
        txtEnergia   = controlJuego.getEnergia();
        txtVida      = controlJuego.getVida();
        txtMunicion  = controlJuego.getMunicion();
        iconoEnergia = controlJuego.getIconoEnergia();
    }
 private void Awake()
 {
     controljuego = GameObject.Find("ControlJuego").GetComponent(typeof(ControlJuego)) as ControlJuego;
 }
Example #7
0
 void Awake()
 {
     instance = this;
 }
Example #8
0
 // Start is called before the first frame update
 void Start()
 {
     boton        = GetComponent <Button>();
     controlJuego = GameObject.Find("GestorJuego").GetComponent <ControlJuego>();
     boton.onClick.AddListener(EstablecerDificultad);
 }
Example #9
0
 // Use this for initialization
 void Start()
 {
     _controlJuego = Camera.main.GetComponent <ControlJuego>();
     _controlNave  = ship.GetComponent <ControlNave>();
 }
Example #10
0
    public Text puntajeText;            // Objeto Text que mara el puntaje

    private void Awake()
    {
        instance = this;
    }
Example #11
0
 void Start()
 {
     _landed             = false;
     reproducirPropulsor = false;
     controlJuego        = Camera.main.GetComponent <ControlJuego>();
 }