Example #1
0
    //---------------------------------------------------------------
    public void pausa()
    {
        if (!menuPausa)
        {
            menuPausa = GameObject.Find("menuPausa").GetComponent <Canvas>();
        }

        if (!_prota)
        {
            _prota = GameObject.Find("Prota").GetComponent <Prota>();
        }

        if (menuPausa.enabled)
        {
            menuPausa.enabled = false;
            Time.timeScale    = 1;
            if (_prota)
            {
                _prota.enabled = true;
            }
        }

        else
        {
            menuPausa.enabled = true;
            Time.timeScale    = 0;
            if (_prota)
            {
                _prota.enabled = false;
            }
        }
    }
Example #2
0
    void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.tag == "Player")
        {
            Stats healthComponent = collision.gameObject.GetComponent <Stats>();
            Prota stun            = collision.gameObject.GetComponent <Prota>();

            stun.stunE();
            healthComponent.VidaActual -= 15;

            Destroy(gameObject);
        }
    }
Example #3
0
    //---------------------------------------------
    protected virtual void Start()
    {
        statsComponent = GameObject.Find("Prota").gameObject.GetComponent <Stats>();

        _daño     = statsComponent.damageFinal;
        _dañoBala = _bala.GetComponent <DañoBalas>();
        _dañoBala.setDaño((int)_daño);

        _balasActuales = balas;
        _estado        = estados.llena;

        balasTxt.text             = "Balas: " + _balasActuales;
        barraRecarga.enabled      = false;
        barraRecargaVacia.enabled = false;
        barraRecargaPunto.enabled = false;

        _prota = GameObject.Find("Prota").GetComponent <Prota>();
    }
Example #4
0
    //---------------------------------------------------------------------------------------------
    void Update()
    {
        if (_prota == null)
        {
            _prota = GameObject.Find("Prota").GetComponent <Prota>();
        }
        if (accion == null)
        {
            accion = GameObject.Find("Accion").GetComponent <Text>();
        }

        switch (_estado)
        {
        case estados.esperando:
            if (Vector3.Distance(gameObject.transform.position, _prota.transform.position) < 3)
            {
                accion.enabled = true;
                accion.text    = "E to examine Board";

                if (Input.GetKeyDown(KeyCode.E))
                {
                    abrirTablero();
                }
            }
            else
            {
                accion.enabled = false;
            }
            break;

        case estados.mostrando:
            accion.text = "Esc to close";

            navegarTablero();

            mostrarMision(misiones[_misionIndex].getInformacion(), papel);

            if (Input.GetKeyDown(KeyCode.Escape))
            {
                cerrarTablero();
            }
            break;
        }
    }
Example #5
0
 void Start()
 {
     statsComponent = GameObject.Find("Prota").gameObject.GetComponent <Stats>();
     protaComponent = GameObject.Find("Prota").gameObject.GetComponent <Prota>();
     armaComponent  = GameObject.Find("Prota").transform.GetChild(0).GetComponent <Arma>();
 }
Example #6
0
    //---------------------------------------------------------------

    /*void Awake(){
     * DontDestroyOnLoad(gameObject);
     * }*/
    //---------------------------------------------------------------
    void Start()
    {
        _prota    = GameObject.Find("Prota").GetComponent <Prota>();
        menuPausa = GameObject.Find("menuPausa").GetComponent <Canvas>();
    }
Example #7
0
 //---------------------------------------------------------------------------------------------
 void Start()
 {
     DontDestroyOnLoad(gameObject);
     _prota     = GameObject.Find("Prota").GetComponent <Prota>();
     _menuPausa = GameObject.Find("gameMaster").GetComponent <MenuPausa>();
 }