private void CreatePlayerUi() { playerUiController = GameObject.Instantiate(playerUiControllerPrefab); RectTransform playerUiAreaTransform = playerUiArea.GetComponent <RectTransform>(); playerUiController.GetComponent <RectTransform>().SetParent(playerUiAreaTransform); playerUiController.Init(); }
public void Init(PlayerProfile playerProfile, string voiceName, MicProfile micProfile) { this.PlayerProfile = playerProfile; this.MicProfile = micProfile; this.Voice = GetVoice(songMeta, voiceName); this.playerUiController = Instantiate(playerUiControllerPrefab, playerUiArea.transform); this.childrenInjector = CreateChildrenInjectorWithAdditionalBindings(); // Inject all foreach (INeedInjection childThatNeedsInjection in GetComponentsInChildren <INeedInjection>()) { childrenInjector.Inject(childThatNeedsInjection); } childrenInjector.Inject(playerUiController); // Init instances playerUiController.Init(PlayerProfile, MicProfile); PlayerScoreController.Init(Voice); }
private void CreatePlayerUi() { playerUiController = Instantiate(playerUiControllerPrefab, playerUiArea.transform); playerUiController.Init(PlayerProfile, MicProfile); }
private void Init() { player.Init(playerUiController, visionController); playerUiController.Init(player); visionController.Init(player, mapController); }