Beispiel #1
0
    public void AttemptToPlace()
    {
        if (!GameManager.instance.TryTakeMoney(attemptingToPlace.cost))
        {
            CleanCursor();
            return;
        }

        Placeable placeable = onCursor.GetComponent <Placeable>();
        TeamEnum  team      = GameManager.instance.currentTeam;

        if (placeable.GetType() == typeof(Building))
        {
            Building building = (Building)placeable;
            building.Place(team);
        }
        else
        {
            placeable.Place(team);
        }



        SetShader("Standard", onCursor.transform.GetChild(0).gameObject);
        attemptingToPlace = null;
    }