public void Init(Player player, bl_UIReferences uir, bl_AIMananger.BotsStats bot = null)
    {
        Bot             = bot;
        UIReference     = uir;
        BackgroundImage = GetComponent <Image>();

        if (Bot != null)
        {
            InitBot();
            return;
        }

        cachePlayer     = player;
        gameObject.name = player.NickName + player.ActorNumber;
        if (player.ActorNumber == PhotonNetwork.LocalPlayer.ActorNumber)
        {
            Color c = BackgroundImage.color;
            c.a = 0.35f;
            BackgroundImage.color = c;
        }
        InitTeam        = player.GetPlayerTeam();
        NameText.text   = player.NickNameAndRole();
        KillsText.text  = player.CustomProperties[PropertiesKeys.KillsKey].ToString();
        DeathsText.text = player.CustomProperties[PropertiesKeys.DeathsKey].ToString();
        ScoreText.text  = player.CustomProperties[PropertiesKeys.ScoreKey].ToString();
        KickButton.SetActive(PhotonNetwork.IsMasterClient && player.ActorNumber != PhotonNetwork.LocalPlayer.ActorNumber && bl_GameData.Instance.MasterCanKickPlayers);
#if LM
        LevelIcon.gameObject.SetActive(true);
        LevelIcon.sprite = bl_LevelManager.Instance.GetPlayerLevelInfo(cachePlayer).Icon;
#else
        LevelIcon.gameObject.SetActive(false);
#endif
    }
Esempio n. 2
0
    /// <summary>
    ///
    /// </summary>
    protected override void Awake()
    {
        if (!isConnected)
        {
            return;
        }

        base.Awake();
        GM           = FindObjectOfType <bl_GameManager>();
        UIReferences = FindObjectOfType <bl_UIReferences>();
        #if ULSP
        DataBase = bl_DataBase.Instance;
        if (DataBase != null)
        {
            DataBase.RecordTime();
        }
#endif
        Mode             = GetGameMode;
        ButtonsClassPlay = UIReferences.ButtonsClassPlay;
        ShowWarningPing  = false;
        showMenu         = true;
        if (AutoTeamSelection)
        {
            if (!isOneTeamMode)
            {
                StartCoroutine(CanSpawnIE());
            }
            else
            {
                CanSpawn = true;
            }
        }
        GetPrefabs();
        bl_UIReferences.Instance.PlayerUI.PlayerUICanvas.enabled = false;
    }
Esempio n. 3
0
    /// <summary>
    ///
    /// </summary>
    protected override void Awake()
    {
        if (!isConnected)
        {
            return;
        }

        base.Awake();
        GM           = FindObjectOfType <bl_GameManager>();
        UIReferences = FindObjectOfType <bl_UIReferences>();
        this.GetComponent <bl_ChatRoom>().AddLine("Play " + GetGameMode.ToString() + " Mode");
        ShowWarningPing = false;
        showMenu        = true;
        if (AutoTeamSelection)
        {
            if (GetGameMode != GameMode.FFA)
            {
                StartCoroutine(CanSpawnIE());
            }
            else
            {
                CanSpawn = true;
            }
        }
        if (VignetteImage && Use_Vignette)
        {
            VignetteImage.color = new Color(VignetteImage.color.r, VignetteImage.color.b, VignetteImage.color.g, VigAlpha);
        }
        StartCoroutine(FadeOut(1.5f));
        GetPrefabs();
        m_CanvasRoot.enabled = false;
    }
Esempio n. 4
0
 /// <summary>
 ///
 /// </summary>
 void Awake()
 {
     if (AutoDestroy)
     {
         Destroy(gameObject, DestroyIn);
     }
     PUM          = FindObjectOfType <bl_PickGunManager>();
     UIReferences = bl_UIReferences.Instance;
 }
Esempio n. 5
0
 protected override void Awake()
 {
     base.Awake();
     UIReferences = bl_UIReferences.Instance;
     AFKTimeLimit = bl_GameData.Instance.AFKTimeLimit;
     if (!bl_GameData.Instance.DetectAFK)
     {
         this.enabled = false;
     }
 }
Esempio n. 6
0
    /// <summary>
    ///
    /// </summary>
    void Awake()
    {
        setting     = this.GetComponent <bl_RoomSettings>();
        UIReference = FindObjectOfType <bl_UIReferences>();
        if (PhotonNetwork.InRoom)
        {
#if LOCALIZATION
            LocaleStrings = bl_Localization.Instance.GetTextArray(LocaleTextIDs);
#endif
            OnJoined();
        }
    }
Esempio n. 7
0
 /// <summary>
 ///
 /// </summary>
 protected override void Awake()
 {
     if (!PhotonNetwork.IsConnected)
     {
         return;
     }
     base.Awake();
     PUM          = FindObjectOfType <bl_PickGunManager>();
     UIReferences = bl_UIReferences.Instance;
     CacheGun     = bl_GameData.Instance.GetWeapon(GunID);
     uniqueLocal  = (byte)Random.Range(0, 9998);
 }
Esempio n. 8
0
 /// <summary>
 ///
 /// </summary>
 protected override void Awake()
 {
     if (!PhotonNetwork.IsConnected)
     {
         bl_UtilityHelper.LoadLevel(bl_GameData.Instance.MainMenuScene);
         return;
     }
     base.Awake();
     RoomSettings = this.GetComponent <bl_RoomSettings>();
     RoomMenu     = GetComponent <bl_RoomMenu>();
     m_Manager    = GetComponent <bl_GameManager>();
     UIReferences = bl_UIReferences.Instance;
     TimeText     = UIReferences.PlayerUI.TimeText;
     Pause        = false;
 }
Esempio n. 9
0
    /// <summary>
    ///
    /// </summary>
    protected override void Awake()
    {
        base.Awake();
        RoomSettings = this.GetComponent <bl_RoomSettings>();
        RoomMenu     = GetComponent <bl_RoomMenu>();
        m_Manager    = GetComponent <bl_GameManager>();
        UIReferences = bl_UIReferences.Instance;
        TimeText     = UIReferences.TimeText;
        if (!PhotonNetwork.connected)
        {
            bl_UtilityHelper.LoadLevel(RoomMenu.LeftRoomReturnScene);
            return;
        }

        GetTime();
    }
Esempio n. 10
0
    public static void CheckGamePadRequired()
    {
        if (bl_InputData.Instance.mappedInstance == null || !bl_InputData.Instance.useGamePadNavigation)
        {
            return;
        }
        if (bl_InputData.Instance.mappedInstance.inputType != InputType.Xbox && bl_InputData.Instance.mappedInstance.inputType != InputType.Playstation)
        {
            return;
        }

        bl_GamePadPointerModule dpm = Object.FindObjectOfType <bl_GamePadPointerModule>();

        if (dpm == null)
        {
            GameObject go = GameObject.Instantiate(bl_InputData.Instance.GamePadInputModule) as GameObject;
            dpm = go.GetComponent <bl_GamePadPointerModule>();
            dpm.CheckCanvas();
        }

        bl_GamePadPointer gmp = bl_GamePadPointer.Instance;

        if (gmp == null)
        {
            bl_UIReferences uir = bl_UIReferences.Instance;
            GameObject      go  = GameObject.Instantiate(bl_InputData.Instance.GamePadPointerPrefab) as GameObject;
            gmp = go.GetComponent <bl_GamePadPointer>();
            if (uir != null)
            {
                Transform parent = uir.transform.GetChild(1);
                go.transform.SetParent(parent, false);
                go.transform.SetAsLastSibling();
            }
            else
            {
                GraphicRaycaster c      = GameObject.FindObjectOfType <GraphicRaycaster>();
                Transform        parent = c.transform;
                go.transform.SetParent(parent, false);
                go.transform.SetAsLastSibling();
            }
        }
    }
Esempio n. 11
0
    public void Init(PhotonPlayer player, bl_UIReferences uir)
    {
        cachePlayer     = player;
        gameObject.name = player.NickName + player.ID;
        UIReference     = uir;

        BackgroundImage = GetComponent <Image>();
        if (player.ID == PhotonNetwork.player.ID)
        {
            Color c = BackgroundImage.color;
            c.a = 0.35f;
            BackgroundImage.color = c;
        }
        InitTeam        = player.GetPlayerTeam();
        NameText.text   = player.NickNameAndRole();
        KillsText.text  = player.CustomProperties[PropertiesKeys.KillsKey].ToString();
        DeathsText.text = player.CustomProperties[PropertiesKeys.DeathsKey].ToString();
        ScoreText.text  = player.CustomProperties[PropertiesKeys.ScoreKey].ToString();
        KickButton.SetActive(PhotonNetwork.isMasterClient && player.ID != PhotonNetwork.player.ID);
    }
Esempio n. 12
0
    /// <summary>
    ///
    /// </summary>
    protected override void Awake()
    {
        base.Awake();
        if (!PhotonNetwork.connected || PhotonNetwork.room == null)
        {
            return;
        }

        RoomMenu     = base.GetComponent <bl_RoomMenu>();
        TimeManager  = base.GetComponent <bl_RoundTime>();
        UIReferences = bl_UIReferences.Instance;
        GameData     = bl_GameData.Instance;
#if BDGM
        BombDefuse = FindObjectOfType <bl_BombDefuse>();
#endif
#if CP
        CoverPoint = FindObjectOfType <bl_CoverPointRoom>();
#endif
        ResetRoom();
        GetRoomInfo();
    }