Ejemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 private void OnTriggerExit(Collider other)
 {
     if (other.transform.CompareTag(bl_PlayerSettings.LocalTag))
     {
         bl_PlayerDamageManager pdm = other.transform.GetComponent <bl_PlayerDamageManager>();
         if (pdm != null)
         {
             if (m_Type == AreaType.Repeting)
             {
                 pdm.CancelRepetingDamage();
                 AllHitted.Remove(pdm);
             }
         }
     }
     else if (other.transform.CompareTag("AI") && !isNetwork)
     {
         bl_AIShooterHealth ash = other.transform.root.GetComponent <bl_AIShooterHealth>();
         if (ash != null)
         {
             if (AIHitted.Contains(ash))
             {
                 AIHitted.Remove(ash);
             }
             if (m_Type == AreaType.Repeting)
             {
                 ash.CancelRepetingDamage();
             }
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 private void OnTriggerEnter(Collider other)
 {
     if (other.transform.CompareTag(bl_PlayerSettings.LocalTag))
     {
         bl_PlayerDamageManager pdm = other.transform.GetComponent <bl_PlayerDamageManager>();
         if (pdm != null)
         {
             if (m_Type == AreaType.Repeting)
             {
                 if (isPlayerCaused)
                 {
                     cacheInformation.Direction = transform.position;
                     int gi = bl_GameData.Instance.GetWeaponID("Molotov");
                     if (gi > 0)
                     {
                         cacheInformation.GunID = gi;
                     }
                     pdm.DoRepetingDamage(Damage, 1, cacheInformation);
                     AllHitted.Add(pdm);
                 }
                 else
                 {
                     pdm.DoRepetingDamage(Damage, 1);
                 }
             }
             else if (m_Type == AreaType.OneTime)
             {
                 DamageData info = new DamageData();
                 info.Damage    = Damage;
                 info.Direction = transform.position;
                 info.Cause     = DamageCause.Fire;
                 pdm.GetDamage(info);
             }
         }
     }
     else if (other.transform.CompareTag("AI") && !isNetwork)
     {
         if (isPlayerCaused)
         {
             bl_AIShooterHealth ash = other.transform.root.GetComponent <bl_AIShooterHealth>();
             if (ash != null)
             {
                 if (!AIHitted.Contains(ash))
                 {
                     cacheInformation.Direction = transform.position;
                     int gi = bl_GameData.Instance.GetWeaponID("Molotov");
                     if (gi > 0)
                     {
                         cacheInformation.GunID = gi;
                     }
                     ash.DoRepetingDamage(Damage, 1, cacheInformation);
                     AIHitted.Add(ash);
                 }
             }
         }
     }
 }
 /// <summary>
 ///
 /// </summary>
 protected override void Awake()
 {
     base.Awake();
     m_Transform = transform;
     bl_PhotonCallbacks.PlayerEnteredRoom += OnPhotonPlayerConnected;
     bl_AIMananger.OnBotStatUpdate        += OnBotStatUpdate;
     Agent                 = this.GetComponent <NavMeshAgent>();
     AIAnim                = GetComponentInChildren <bl_AIAnimation>();
     AIHealth              = GetComponent <bl_AIShooterHealth>();
     AIWeapon              = GetComponent <bl_AIShooterWeapon>();
     defaultSpeed          = Agent.speed;
     Anim                  = GetComponentInChildren <Animator>();
     ObstacleBetweenTarget = false;
     CoverManager          = FindObjectOfType <bl_AICovertPointManager>();
     AIManager             = CoverManager.GetComponent <bl_AIMananger>();
     TimeManager           = FindObjectOfType <bl_RoundTime>();
     DrawName              = GetComponent <bl_DrawName>();
     m_GameMode            = GetGameMode;
 }
Ejemplo n.º 4
0
    protected override void Awake()
    {
        base.Awake();
#if !UNITY_WEBGL && PVOICE
        if (!isBot)
        {
            PRecorder = GetComponent <PhotonVoiceView>();
        }
#endif
        if (!isBot)
        {
            DamagerManager = GetComponent <bl_PlayerDamageManager>();
        }
        else
        {
            AIHealth = GetComponent <bl_AIShooterHealth>();
        }
        ShowHealthBar = bl_GameData.Instance.ShowTeamMateHealthBar;
    }
Ejemplo n.º 5
0
    public void Show(string killer, int gunID)
    {
        bl_GunInfo info = bl_GameData.Instance.GetWeapon(gunID);

        GunImage.sprite     = info.GunIcon;
        GunNameText.text    = info.Name.ToUpper();
        KillerNameText.text = killer;
#if LOCALIZATION
        KillCamSpectatingText.text = string.Format("<size=8>{0}:</size>\n{1}", bl_Localization.Instance.GetText(26).ToUpper(), killer);
#else
        KillCamSpectatingText.text = string.Format("<size=8>{0}:</size>\n{1}", bl_GameTexts.Spectating.ToUpper(), killer);
#endif
        bl_GameManager.SceneActors actor = bl_GameManager.Instance.FindActor(killer);
        if (actor != null)
        {
            if (actor.isRealPlayer)
            {
                bl_PlayerDamageManager pdm = actor.Actor.GetComponent <bl_PlayerDamageManager>();
                int health = Mathf.FloorToInt(pdm.health);
                if (pdm != null)
                {
                    KillerHealthText.text = string.Format("HEALTH: {0}", health);
                }
            }
            else
            {
                bl_AIShooterHealth pdm = actor.Actor.GetComponent <bl_AIShooterHealth>();
                int health             = Mathf.FloorToInt(pdm.Health);
                if (pdm != null)
                {
                    KillerHealthText.text = string.Format("HEALTH: {0}", health);
                }
            }
        }
        else
        {
            KillerHealthText.text = string.Empty;
        }
    }