Exemple #1
0
    void OnMouseDown()
    {
        if (buildManager.GetTurretToBuild() == null)
        {
            return;
        }

        if (turret != null)
        {
            Debug.Log("Can't build there! - TODO Display on Screen");
            return;
        }

        GameObject turretToBuild = buildManager.GetTurretToBuild();

        turret = (GameObject)Instantiate(turretToBuild, transform.position + positionOffset, transform.rotation);
        buildManager.SetTurretToBuild(null);
    }
Exemple #2
0
    private void OnMouseDown()
    {
        if (EventSystem.current.IsPointerOverGameObject())
        {
            return;
        }
        if (turret != null)
        {
            buildManger.SelectNode(this);
            return;
        }

        if (!buildManger.CanBuild)
        {
            return;
        }
        BuildTurret(buildManger.GetTurretToBuild());
    }