Beispiel #1
0
    void Update()
    {
        if (hologram != null)
        {
            RaycastHit hit;
            Ray        ray = Camera.main.ScreenPointToRay(GameManager.instance.inputManager.mousePosition);
            if (Physics.Raycast(ray, out hit))
            {
                if (!GameManager.instance.inputManager.overElement && GameManager.instance.gridManager.IsInside(hit.point))
                {
                    hologram.transform.position = GameManager.instance.gridManager.PositionInWorld(
                        GameManager.instance.gridManager.PositionInGrid(hit.point)
                        );

                    if (GameManager.instance.constructionManager.selectedTowerIndex > -1)
                    {
                        rangeDrawer.Draw(
                            hologram.transform.position,
                            GameManager.instance.constructionManager.towers[GameManager.instance.constructionManager.selectedTowerIndex].range
                            );
                    }
                }
            }
        }
    }
Beispiel #2
0
    void SelectTower(TowerBehavior _selectedTower)
    {
        selectedTower = _selectedTower;

        rangeDrawer.Draw(selectedTower.transform.position, selectedTower.param.range, 50);
        GameManager.instance.interfaceManager.towerInterface.ShowTowerInformation
        (
            selectedTower,
            new Vector2(Screen.width / 10, Screen.height / 2)
        );
    }