Пример #1
0
        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
        }
Пример #2
0
    private static bool IntegrateValidate()
    {
        bl_PlayerSelector km = GameObject.FindObjectOfType <bl_PlayerSelector>();
        bl_GameManager    gm = GameObject.FindObjectOfType <bl_GameManager>();

        return(km == null && gm != null);
    }
Пример #3
0
    /// <summary>
    /// Spawn Player Function
    /// </summary>
    /// <param name="t_team"></param>
    public void SpawnPlayer(Team t_team)
    {
        if (!bl_RoomMenu.Instance.SpectatorMode)
        {
            if (OurPlayer != null)
            {
                PhotonNetwork.Destroy(OurPlayer);
            }
            if (!GameFinish)
            {
                Hashtable PlayerTeam = new Hashtable();
                PlayerTeam.Add(PropertiesKeys.TeamKey, t_team.ToString());
                PhotonNetwork.LocalPlayer.SetCustomProperties(PlayerTeam, null);
                LocalPlayerTeam = t_team;

                //spawn the player model
#if !PSELECTOR
                SpawnPlayerModel(t_team);
                m_RoomCamera.gameObject.SetActive(false);
                StartCoroutine(bl_UIReferences.Instance.FinalFade(false, false, 0));
                bl_UtilityHelper.LockCursor(true);
                if (!Joined)
                {
                    StartPlayTime = Time.time;
                }
                Joined = true;

#if UMM
                MiniMapCanvas.enabled = true;
#endif
#else
                bl_PlayerSelector ps = FindObjectOfType <bl_PlayerSelector>();
                if (ps.IsSelected && !ps.isChangeOfTeam)
                {
                    ps.SpawnSelected();
                }
                else
                {
                    ps.OpenSelection(t_team);
                }
#endif
            }
            else
            {
                m_RoomCamera.gameObject.SetActive(true);
            }
        }
        else
        {
            this.GetComponent <bl_RoomMenu>().WaitForSpectator = true;
        }
    }
Пример #4
0
    /// <summary>
    /// Spawn Player Function
    /// </summary>
    /// <param name="t_team"></param>
    public void SpawnPlayer(Team t_team)
    {
        if (!this.GetComponent <bl_RoomMenu>().SpectatorMode)
        {
            if (OurPlayer != null)
            {
                PhotonNetwork.Destroy(OurPlayer);
            }
            if (!GameFinish)
            {
                Hashtable PlayerTeam = new Hashtable();
                PlayerTeam.Add(PropertiesKeys.TeamKey, t_team.ToString());
                PhotonNetwork.player.SetCustomProperties(PlayerTeam, null, true);

                //spawn the player model
#if !PSELECTOR
                SpawnPlayerModel(t_team);

                Chat.Refresh();
                m_RoomCamera.gameObject.SetActive(false);
                StartCoroutine(bl_RoomMenu.FadeOut(1));
                bl_UtilityHelper.LockCursor(true);
                Joined = true;
#else
                bl_PlayerSelector ps = FindObjectOfType <bl_PlayerSelector>();
                if (ps.IsSelected)
                {
                    ps.SpawnSelected();
                }
                else
                {
                    ps.OpenSelection(t_team);
                }
#endif
            }
            else
            {
                m_RoomCamera.gameObject.SetActive(true);
            }
        }
        else
        {
            this.GetComponent <bl_RoomMenu>().WaitForSpectator = true;
        }
    }