public void Set(bl_PlayerSelectorInfo info, bl_PlayerSelector script) { Info = info; PlayerPreview.sprite = info.Preview; PlayerNameText.text = string.Format("<b>NAME:</b> {0}", info.Name.ToUpper()); Selector = script; if (info.Prefab != null) { bl_PlayerHealthManager pdm = info.Prefab.GetComponent <bl_PlayerHealthManager>(); bl_FirstPersonController fpc = info.Prefab.GetComponent <bl_FirstPersonController>(); HealthText.fillAmount = pdm.health / 125; SpeedText.fillAmount = fpc.WalkSpeed / 5; RegenerationText.fillAmount = pdm.RegenerationSpeed / 5; NoiseText.fillAmount = 0.9f; } #if SHOP && ULSP if (info.Price > 0 && bl_DataBase.Instance != null) { int pID = bl_PlayerSelectorData.Instance.GetPlayerID(info.Name); bool unlock = bl_DataBase.Instance.LocalUser.ShopData.isItemPurchase(ShopItemType.PlayerSkin, pID); LockedUI.SetActive(!unlock); } else { LockedUI.SetActive(false); } #else LockedUI.SetActive(false); #endif }
public void SetUp(bl_PlayerSelectorInfo info, Team team) { UITeam = team; TeamNameText.text = team.GetTeamName().ToUpper(); OperatorNameText.text = info.Name.ToUpper(); PreviewImage.sprite = info.Preview; bool fav = (team == bl_PlayerSelectorData.GetFavoriteTeam()); FavButton.SetActive(!fav); FavUI.SetActive(fav); }
/// <summary> /// /// </summary> void InitialSetUp() { int team1op = bl_PlayerSelectorData.GetTeamOperatorID(Team.Team1); int team2op = bl_PlayerSelectorData.GetTeamOperatorID(Team.Team2); Team1PlayerInfo = bl_PlayerSelectorData.Instance.GetPlayerByIndex(team1op); Team2PlayerInfo = bl_PlayerSelectorData.Instance.GetPlayerByIndex(team2op); TeamsUI[0].SetUp(Team1PlayerInfo, Team.Team1); TeamsUI[1].SetUp(Team2PlayerInfo, Team.Team2); }
public List <bl_PlayerSelectorInfo> GetPlayerList(Team team) { List <bl_PlayerSelectorInfo> list = new List <bl_PlayerSelectorInfo>(); List <int> ids = team == Team.Team1 ? Team1Players : Team2Players; for (int i = 0; i < ids.Count; i++) { bl_PlayerSelectorInfo info = AllPlayers[ids[i]]; info.ID = ids[i]; info.team = team; list.Add(info); } return(list); }
public void SelectOperator(bl_PlayerSelectorInfo operatorInfo) { bl_PlayerSelectorData.SetTeamOperator(operatorInfo.ID, operatorInfo.team); OnShowUpOp(operatorInfo); Team t = operatorInfo.team; TeamsUI[((int)t - 1)].SetUp(bl_PlayerSelectorData.Instance.GetPlayerByIndex(operatorInfo.ID), t); if (t == Team.Team1) { Team1PlayerInfo = operatorInfo; } else { Team2PlayerInfo = operatorInfo; } }
public void SetUp(bl_PlayerSelectorInfo info, bl_PlayerSelectorLobby manager) { Manager = manager; cacheInfo = info; PreviewImage.sprite = info.Preview; SelectedUI.SetActive(info.isEquipedOne()); #if SHOP && ULSP if (info.Price > 0 && bl_DataBase.Instance != null) { int pID = bl_PlayerSelectorData.Instance.GetPlayerID(info.Name); bool unlock = bl_DataBase.Instance.LocalUser.ShopData.isItemPurchase(ShopItemType.PlayerSkin, pID); isBlocked = !unlock; BlockedUI.SetActive(!unlock); } else { BlockedUI.SetActive(false); } #else BlockedUI.SetActive(false); #endif }
public void ShowUpSelectedOne(Team showingTeam) { bl_PlayerSelectorInfo player = showingTeam == Team.Team1 ? Team1PlayerInfo : Team2PlayerInfo; OnShowUpOp(player); }
public void OnShowUpOp(bl_PlayerSelectorInfo operatorInfo) { TeamNameSelectorText.text = operatorInfo.team.GetTeamName().ToUpper(); OperatorSelectorText.text = operatorInfo.Name.ToUpper(); OperatorSelectorImg.sprite = operatorInfo.Preview; }