Exemple #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
        }
#pragma warning disable 0414


    protected override void Awake()
    {
        base.Awake();
        if (!PhotonNetwork.connected)
        {
            Destroy(this);
        }

        //FirstUpdate = false;
        if (!this.isMine)
        {
            if (HeatTarget.gameObject.activeSelf == false)
            {
                HeatTarget.gameObject.SetActive(true);
            }
        }

        m_PositionControl = new PhotonTransformViewPositionControl(m_PositionModel);
        m_RotationControl = new PhotonTransformViewRotationControl(m_RotationModel);
        m_ScaleControl    = new PhotonTransformViewScaleControl(m_ScaleModel);
        Controller        = GetComponent <bl_FirstPersonController>();
        Settings          = GetComponent <bl_PlayerSettings>();
        PDM           = GetComponent <bl_PlayerDamageManager>();
        DrawName      = GetComponent <bl_DrawName>();
        RoomMenu      = FindObjectOfType <bl_RoomMenu>();
        m_CController = GetComponent <CharacterController>();
        FrienlyFire   = (bool)PhotonNetwork.room.CustomProperties[PropertiesKeys.RoomFriendlyFire];
    }
 public void Awake()
 {
     this.myTransform = this.transform;
     DefaultRot       = myTransform.localRotation;
     DefaultPos       = myTransform.localPosition;
     controller       = this.transform.root.GetComponent <bl_FirstPersonController>();
     Gun = transform.parent.GetComponent <bl_Gun>();
 }
Exemple #4
0
 /// <summary>
 ///
 /// </summary>
 protected override void Awake()
 {
     base.Awake();
     //Find player and FPScontroller script
     player   = transform.root.gameObject;
     motor    = player.GetComponent <bl_FirstPersonController>();
     midpoint = transform.localPosition;
     Dsmooth  = smooth;
 }
Exemple #5
0
 /// <summary>
 ///
 /// </summary>
 protected override void Awake()
 {
     base.Awake();
     player        = transform.root.gameObject;
     motor         = player.GetComponent <bl_FirstPersonController>();
     midpoint      = transform.localPosition;
     localRotation = transform.localEulerAngles;
     Intensitity   = 1;
     m_Transform   = transform;
 }
Exemple #6
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag(bl_PlayerSettings.LocalTag))
     {
         bl_FirstPersonController fpc = other.GetComponent <bl_FirstPersonController>();
         fpc.PlatformJump(JumpForce);
         if (JumpSound != null)
         {
             AudioSource.PlayClipAtPoint(JumpSound, transform.position);
         }
     }
 }
    //TODO

    /* Add FootSteps - Done
     * Jump detection - Done
     * Land detection - Done
     * Pos Share?
     */
    // Use this for initialization
    void Start()
    {
        originalLocalPos = head.localPosition;
        character        = transform.root.GetComponent <bl_FirstPersonController>();
        if (GetComponent <AudioSource>() == null)
        {
            // we automatically add an audiosource, if one has not been manually added.
            // (if you want to control the rolloff or other audio settings, add an audiosource manually)
            gameObject.AddComponent <AudioSource>();
        }
        prevPosition     = transform.position;
        DefaultFrequemcy = headBobFrequency;
    }
Exemple #8
0
    public void Preview(bl_ShopItemData info, bool isOwned)
    {
        foreach (Image i in PreviewIcons)
        {
            i.gameObject.SetActive(false);
        }
        InfoPanel.SetActive(true);
        infoPreviewData       = info;
        PreviewNameText.text  = info.Name.ToUpper();
        PreviewPriceText.text = string.Format("PRICE {0}{1}", bl_ShopData.Instance.PricePrefix, info.Price);
        if (info.Type == ShopItemType.Weapon)
        {
            PreviewIcons[0].gameObject.SetActive(true);
            PreviewIcons[0].sprite = info.GunInfo.GunIcon;
            PreviewBars[0].transform.parent.parent.GetComponentInChildren <Text>().text = "DAMAGE:";
            PreviewBars[0].fillAmount = (float)info.GunInfo.Damage / 100f;
            PreviewBars[1].transform.parent.parent.GetComponentInChildren <Text>().text = "FIRE RATE:";
            PreviewBars[1].fillAmount = info.GunInfo.FireRate / 1f;
            PreviewBars[2].transform.parent.parent.GetComponentInChildren <Text>().text = "ACCURACY:";
            PreviewBars[2].fillAmount = (float)info.GunInfo.Accuracy / 5f;
            PreviewBars[3].transform.parent.parent.GetComponentInChildren <Text>().text = "WEIGHT:";
            PreviewBars[3].fillAmount = (float)info.GunInfo.Weight / 4f;
        }
        else if (info.Type == ShopItemType.PlayerSkin)
        {
#if PSELECTOR
            PreviewIcons[1].gameObject.SetActive(true);
            PreviewIcons[1].sprite = info.PlayerSkinInfo.Preview;
            bl_PlayerHealthManager   pdm = info.PlayerSkinInfo.Prefab.GetComponent <bl_PlayerHealthManager>();
            bl_FirstPersonController fpc = info.PlayerSkinInfo.Prefab.GetComponent <bl_FirstPersonController>();
            PreviewBars[0].transform.parent.parent.GetComponentInChildren <Text>().text = "HEALTH:";
            PreviewBars[0].fillAmount = pdm.health / 125;
            PreviewBars[1].transform.parent.parent.GetComponentInChildren <Text>().text = "SPEED:";
            PreviewBars[1].fillAmount = fpc.WalkSpeed / 5;
            PreviewBars[2].transform.parent.parent.GetComponentInChildren <Text>().text = "REGENERATION:";
            PreviewBars[2].fillAmount = pdm.RegenerationSpeed / 5;
            PreviewBars[3].transform.parent.parent.GetComponentInChildren <Text>().text = "NOISE:";
            PreviewBars[3].fillAmount = 0.9f;
#endif
        }
        else if (info.Type == ShopItemType.WeaponCamo)
        {
#if CUSTOMIZER
            PreviewIcons[2].gameObject.SetActive(true);
            PreviewIcons[2].sprite = info.camoInfo.spritePreview();
            InfoPanel.SetActive(false);
#endif
        }
        BuyPreviewButton.SetActive(!isOwned);
    }
    /// <summary>
    ///
    /// </summary>
    protected override void Awake()
    {
        base.Awake();
        PlayerRoot = transform.root;

        useFootSteps = bl_GameData.Instance.CalculateNetworkFootSteps;
        if (useFootSteps)
        {
            bl_FirstPersonController fpc = PlayerRoot.GetComponent <bl_FirstPersonController>();
            m_RunStepInterval       = fpc.m_RunStepInterval;
            m_StepInterval          = fpc.m_StepInterval;
            StepSource              = gameObject.AddComponent <AudioSource>();
            StepSource.spatialBlend = 1;
            StepSource.maxDistance  = 15;
            StepSource.playOnAwake  = false;
        }
    }
Exemple #10
0
#pragma warning disable 0414


    protected override void Awake()
    {
        base.Awake();
        bl_PhotonCallbacks.PlayerEnteredRoom += OnPhotonPlayerConnected;
        if (!PhotonNetwork.IsConnected)
        {
            Destroy(this);
        }
        if (!PhotonNetwork.InRoom)
        {
            return;
        }

        //FirstUpdate = false;
        if (!isMine)
        {
            if (HeatTarget.gameObject.activeSelf == false)
            {
                HeatTarget.gameObject.SetActive(true);
            }
        }

        m_PositionControl = new PhotonTransformViewPositionControl(m_PositionModel);
        m_RotationControl = new PhotonTransformViewRotationControl(m_RotationModel);
        Controller        = GetComponent <bl_FirstPersonController>();
        PDM           = GetComponent <bl_PlayerDamageManager>();
        DrawName      = GetComponent <bl_DrawName>();
        m_CController = GetComponent <CharacterController>();
        FrienlyFire   = (bool)PhotonNetwork.CurrentRoom.CustomProperties[PropertiesKeys.RoomFriendlyFire];
#if UMM
        MiniMapItem = this.GetComponent <bl_MiniMapItem>();
        if (isMine && MiniMapItem != null)
        {
            MiniMapItem.enabled = false;
        }
#endif
    }