Example #1
0
        /// <summary>
        /// 通过cid获取单位
        /// </summary>
        public CAIController GetUnit(int cid)
        {
            CAIController value = null;
            bool          b     = m_pawnEntityList.TryGetValue(cid, out value);

            return(value);
        }
Example #2
0
 protected override void OnDestroy()
 {
     base.OnDestroy();
     m_brainComp       = null;
     BlackBorad        = null;
     InterestingTarget = null;
     m_perceptionComp  = null;
 }
Example #3
0
        /// <summary>
        /// 获取我敌对的团队
        /// </summary>
        public List <CAIController> GetEnemyList(CAIController actor)
        {
            if (actor.Pawn.Team == CPawnEntity.TeamSide.Blue)
            {
                return(m_redGroup);
            }

            return(m_blueGroup);
        }
Example #4
0
        /// <summary>
        /// 选择一个角色为当前操作的角色
        /// </summary>
        /// <param name="ctrl"></param>
        public void SelectPawnCtrl(CPlayerController ctrl)
        {
            if (ctrl == null)
            {
                return;
            }
            ctrl.IgnoreInput       = false;
            ctrl.InterestingTarget = null;

            m_selectedPawnCtrl = ctrl;
        }
Example #5
0
        /// <summary>
        /// 添加单位到场景
        /// </summary>
        /// <param name="unit"></param>
        public void AddUnit(CAIController unit)
        {
            m_pawnEntityList.Add(unit.Pawn.CId, unit);

            if (unit.Pawn.Team == CPawnEntity.TeamSide.Red)
            {
                m_redGroup.Add(unit);
            }
            else if (unit.Pawn.Team == CPawnEntity.TeamSide.Blue)
            {
                m_blueGroup.Add(unit);
            }
        }
Example #6
0
 /// <summary>
 /// 清理游戏
 /// </summary>
 public virtual void OnDestroy()
 {
     m_enabled          = false;
     m_selectedPawnCtrl = null;
 }