public void Present(BuidingProfile profile) { Icon.sprite = profile.Icon; BuildingName.text = profile.Name; Button.onClick.AddListener(() => { Placer.Instance.Place(profile); }); }
public void Place(BuidingProfile building) { if (_currentPlaced != null) { return; } GameObject ghost = Instantiate(building.BuildingView); _currentPlaced = new PlacedEntity(ghost.GetComponent <BuildingView>(), ghost.GetComponent <CollisionTrigger>(), building); }
public PlacedEntity(BuildingView view, CollisionTrigger trigger, BuidingProfile profile) { _view = view; _trigger = trigger; _profile = profile; }
public void Init(BuidingProfile profile) { _possibleProduction = profile.PossibleProduction; Profile = profile; }