// PRAGMA MARK - Internal protected override void Init() { if (string.IsNullOrEmpty(Player_.Nickname)) { Player_.Nickname = RegisteredPlayers.GetDefaultNicknameFor(Player_); } Player_.Skin = null; ObjectPoolManager.Create(GamePrefabs.Instance.CanJoinViewPrefab, parent: Container_); }
public void HandleOkButtonPressed() { if (string.IsNullOrEmpty(Nickname_)) { player_.Nickname = RegisteredPlayers.GetDefaultNicknameFor(player_); } else { player_.Nickname = Nickname_; } onFinishCustomization_.Invoke(); AudioConstants.Instance.UIBeep.PlaySFX(); }
protected override void Init() { if (string.IsNullOrEmpty(Player_.Nickname)) { Player_.Nickname = RegisteredPlayers.GetDefaultNicknameFor(Player_); } if (Player_.Skin == null) { Player_.Skin = RegisteredPlayersUtil.GetBestRandomSkin(); } GameObject skinSelectionContainer = GameObjectUtil.FindRequired("SkinSelectionContainer"); SkinSelectable currentSelectable = skinSelectionContainer.GetComponentsInChildren <SkinSelectable>().First(s => s.Skin == Player_.Skin); selectionView_ = ObjectPoolManager.CreateView <ElementSelectionView>(GamePrefabs.Instance.ElementSelectionViewPrefab); selectionView_.Init(Player_, skinSelectionContainer, startSelectable: currentSelectable); selectionView_.OnSelectableHover += HandleSelectableHover; selectionView_.OnSelectableSelected += HandleSelectableSelected; // we're selecting skins right now selectingSkinMap_[Player_] = true; OnSelectedSkinsDirty.Invoke(); }