private void CreateAndInitTravelOptions(TravelTo i_travelTo) { foreach (TravelOption option in i_travelTo.TravelOptions) { GameObject optionObject = gameObject.InstantiateUI(TravelOptionPrefab, TravelOptionContent); TravelOptionView optionView = optionObject.GetComponent <TravelOptionView>(); optionView.Init(option); } }
private void CreateTravelToView() { TravelTo travelTo = new TravelTo(PlayerManager.Data.GetMapDataForWorld(BackendConstants.WORLD_BASE)); GameObject mainCanvas = GameObject.FindGameObjectWithTag("MainCanvas"); GameObject travelToUI = gameObject.InstantiateUI(TravelToPopupPrefab, mainCanvas); TravelToView view = travelToUI.GetComponent <TravelToView>(); view.Init(travelTo); }
public void Init(TravelTo i_travelTo) { SetModel(i_travelTo.ViewModel); SubscribeToMessages(); CreateAndInitTravelOptions(i_travelTo); }