void Update() { //TODO Check overlay pointer Ray ray = camera.ScreenPointToRay(Input.mousePosition); Debug.DrawRay(transform.position, ray.direction); RaycastHit[] hits; if (!GlobalMap.instance.GAMEPAUSED) { if (Input.GetMouseButtonDown(0)) { hits = Physics.RaycastAll(ray); foreach (RaycastHit hit in hits) { Tile hitTile = hit.collider.gameObject.GetComponent <Tile>(); if (hitTile != null) { playerUnit.SetDestanation(map.GeneratePathTo(hitTile.tileX, hitTile.tileZ, playerUnit.tileX, playerUnit.tileZ)); } } } } //TEST Remove warfog if (Input.GetKeyDown(KeyCode.X)) { if (map.globalWarfogEnabled) { foreach (Tile tile in map.tiles) { tile.WarFogEnabled = false; } map.globalWarfogEnabled = false; } else { map.globalWarfogEnabled = true; map.ReShowWarFog(); } } // Game Pause if (Input.GetKeyDown(KeyCode.Space)) { map.GAMEPAUSED = !map.GAMEPAUSED; } // Center camera on Player if (Input.GetKeyDown(KeyCode.C)) { CenterCameraOnPlayer(); } //TEST instant step if (Input.GetKeyDown(KeyCode.E)) { playerUnit.movementCD = 0; } }