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
    }
예제 #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;
    }
예제 #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;
    }
예제 #4
0
 /// <summary>
 ///
 /// </summary>
 void Awake()
 {
     if (AutoDestroy)
     {
         Destroy(gameObject, DestroyIn);
     }
     PUM          = FindObjectOfType <bl_PickGunManager>();
     UIReferences = bl_UIReferences.Instance;
 }
예제 #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;
     }
 }
예제 #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();
        }
    }
예제 #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);
 }
예제 #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;
 }
예제 #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();
    }
예제 #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();
            }
        }
    }
예제 #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);
    }
예제 #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();
    }