Beispiel #1
0
 void Update()
 {
     if (EstadosJuego.Iniciado())
     {
         if (EstadosJuego.EstadoActual() != EstadosJuego.Estado.MENU)
         {
             HandleMovementInput();
         }
     }
 }
Beispiel #2
0
    void CheckMousse()
    {
        if (EstadosJuego.EstadoActual() == EstadosJuego.Estado.EXPLORAR)
        {
            if (Input.GetMouseButtonDown(0))
            {
                Ray        ray = cam.ScreenPointToRay(Input.mousePosition);
                RaycastHit hit;

                if (Physics.Raycast(ray, out hit))
                {
                    if (!hit.collider.CompareTag("Muro"))
                    {
                        motor.MoverAlPunto(hit.point);
                    }
                }
            }
        }
        else if (EstadosJuego.EstadoActual() == EstadosJuego.Estado.COMBATE)
        {
            Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);

            RaycastHit hit;
            if (Physics.Raycast(ray, out hit))
            {
                if (hit.collider.tag == "Tile")
                {
                    Tile c = hit.collider.GetComponent <Tile>();

                    if (c.selectable)
                    {
                        c.target = true;
                        if (Input.GetMouseButton(0))
                        {
                            //activar unidad para colocarla
                            GameObject unidadProvisional = (GameObject)Resources.Load("Unidades/UnidadSRC"); //ESTO HAY QUE CAMBIARLO!!!

                            CombateManager.instance.crearUnidad(unidadProvisional, c);
                            Debug.Log("Colocando " + unidadProvisional + " en " + c);
                        }
                    }
                }
            }
        }
    }
Beispiel #3
0
    void Update()
    {
        CheckTeclado();

        if (cam != null)
        {
            CheckMousse();
        }
        else
        {
            cam = Camera.main;
        }

        if (EstadosJuego.EstadoActual() == EstadosJuego.Estado.EXPLORAR)
        {
            CheckPuerta();
            CheckSala();
        }
    }