/// <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;
 }
Beispiel #2
0
    private void OnDrawGizmos()
    {
        if (CoverManager == null)
        {
            CoverManager = FindObjectOfType <bl_AICovertPointManager>();
            TryTimes++;
            if (TryTimes > 2)
            {
                Debug.LogWarning("There is not a cover point manager in scene!");
            }
            return;
        }
        if (!CoverManager.ShowGizmos)
        {
            return;
        }

        Gizmos.color = Color.blue;
        Gizmos.DrawWireSphere(transform.position, 1);
        Gizmos.DrawCube(transform.position, new Vector3(1, 0.1f, 1));
    }