// Start is called before the first frame update public void Init() { _trackPlacer = FindObjectOfType <TrackPlacer>(); if (_building == null) { return; } image.sprite = _building.previewImage; Buyable buyable = _building.GetBuyable(); if (buyable is Object) { _buyable = (Buyable)Instantiate((Object)buyable, transform); } }
// Start is called before the first frame update void Start() { trackPlacer = FindObjectOfType <TrackPlacer>(); trackManager = TrackManager.Instance; moneyManager = MoneyManager.Instance; }