コード例 #1
0
    public void Present(BuidingProfile profile)
    {
        Icon.sprite       = profile.Icon;
        BuildingName.text = profile.Name;

        Button.onClick.AddListener(() =>
        {
            Placer.Instance.Place(profile);
        });
    }
コード例 #2
0
    public void Place(BuidingProfile building)
    {
        if (_currentPlaced != null)
        {
            return;
        }

        GameObject ghost = Instantiate(building.BuildingView);

        _currentPlaced = new PlacedEntity(ghost.GetComponent <BuildingView>(),
                                          ghost.GetComponent <CollisionTrigger>(),
                                          building);
    }
コード例 #3
0
 public PlacedEntity(BuildingView view, CollisionTrigger trigger, BuidingProfile profile)
 {
     _view    = view;
     _trigger = trigger;
     _profile = profile;
 }
コード例 #4
0
 public void Init(BuidingProfile profile)
 {
     _possibleProduction = profile.PossibleProduction;
     Profile             = profile;
 }