bool InFoV()
    {
        //GameLauncher5.GetInstance().aiPlayerList
        Debug.LogError("Athis.manGroup" + this.manGroup + " " + solideIndex);
        foreach (GameObject enemy in GameLauncher5.GetInstance().aiPlayerList)
        {
            AI3DPlayer aIPlayer = enemy.GetComponent <AI3DPlayer>();
            Debug.LogError("this.manGroup@@" + this.manGroup + " " + solideIndex + " " + aIPlayer.SOLIDER_INDEX + " " + aIPlayer.belongGroup);
            if (solideIndex != aIPlayer.SOLIDER_INDEX && aIPlayer.belongGroup != manGroup)
            {
                Debug.LogError("this.manGroup" + this.manGroup + " " + solideIndex);
                Target = enemy.transform;
                Vector3 DirToTarget = Target.position - EyePoint.position;                //取得目标的方向
                float   Angle       = Vector3.Angle(EyePoint.forward, DirToTarget);       //获取正前方和目标之间的角度

                //EyePoint.right
                if (Angle <= FieldOfView)
                {
                    return(true);
                }                               //确定敌人是否在视野中,但不考虑任何物理障碍
            }
        }
        Target = null;
        return(false);
    }
    bool ClearLineofSight()//士兵的眼睛和敌人是否存在任何物理障碍
    {
        foreach (GameObject enemy in GameLauncher5.GetInstance().aiPlayerList)
        {
            AI3DPlayer aIPlayer = enemy.GetComponent <AI3DPlayer>();



            RaycastHit Info;
//			Target = enemy.transform;
            Transform[] rect = enemy.transform.GetComponentsInChildren <Transform> ();
            foreach (Transform ts in rect)
            {
                if (ts.name == "EyePoint")
                {
                    Target = ts;
                }
            }
            if (solideIndex != aIPlayer.SOLIDER_INDEX &&
                aIPlayer.belongGroup != manGroup &&
                Physics.Raycast(EyePoint.position, (Target.position - EyePoint.position).normalized, out Info, ThisCollider.radius, layer))
            {
                Ray        ray = new Ray(EyePoint.position, (Target.position - EyePoint.position).normalized);
                RaycastHit hit;
                Physics.Raycast(ray, out hit, 1000.0f, layer);
                Debug.DrawLine(ray.origin, hit.point, Color.red);
//				Debug.DrawLine (Target.position,(EyePoint.position-Target.position).normalized,Color.red);
//				Debug.DrawLine (EyePoint.position,(Target.position-EyePoint.position).normalized,Color.yellow);
//
//				Debug.DrawLine (EyePoint.position,Target.position,Color.green);
//				if (Info.transform.CompareTag("Player") )
                if (Info.collider.transform.tag.Equals("EnemyPhy"))
                {
                    if (manGroup == AIPlayerGroup.A)
                    {
                        GameObject.Find("lab_state3").GetComponent <Text>().text = manGroup + " " + aIPlayer.SOLIDER_INDEX;
                    }
                    else
                    {
                        GameObject.Find("lab_state4").GetComponent <Text>().text = manGroup + " " + aIPlayer.SOLIDER_INDEX;
                    }

                    //Debug.LogError ("如果看到敌人");
                    Debug.LogError("如果看到敌人:" + manGroup + " " + Info.transform.gameObject.name);
                    enemyObj = Info.transform.gameObject;
                    return(true);
                }                //如果看到敌人
            }
        }
        Target = null;
        return(false);
    }
    //执行射击
    public override void Shoot()
    {
        refreshStateLabel("射击");
        if (ThisLineSight.enemyObj != null)
        {
            ammoNum--;
            refreshStateLabel("执行射击 子弹数量:" + ammoNum);
            Debug.LogError("ThisLineSight.enemyObj." + ThisLineSight.enemyObj.name + " " + this.transform.name);
            Transform realPhy = ThisLineSight.enemyObj.transform.parent.Find("EyePoint");
            transform.LookAt(realPhy);

            Debug.LogError("shoot function");
            animator.SetBool("Walk", false);
            animator.SetBool("Run", false);
            animator.Play("Shoot");
            //animator.SetBool("Shoot", true);

            //		shootTimer -= Time.deltaTime;
            //        if (shootTimer <= 0)
            //        {
            //SetAmmo(1);
            //            shootTimer = 0.9f;
            // 用一个RaycastHit对象保存射线的碰撞结果
            RaycastHit info;
            // 从枪口所在位置向摄像机面向的正前方发出一条射线
            // 该射线只与layer指定的层发生碰撞
            Transform origal = this.transform.Find("EyePoint");


            bool hit = Physics.Raycast(origal.position, (realPhy.position - origal.position).normalized * 1000, out info, 1000, layer);

            //Debug.Log(info.point);
            Debug.DrawLine(origal.position, (realPhy.position - origal.position).normalized * 1000);


            GameObject bulletObject = Instantiate(Resources.Load("Prefab/Bullet3D")) as GameObject;

            bulletObject.transform.position = origal.position;
            bulletObject.GetComponent <BulletScript3D> ().bulleGroup = belongGroup;
            bulletObject.GetComponent <BulletScript3D> ().RuningBullet(origal.position, origal.position + (realPhy.position - origal.position).normalized * 1000);
            GameLauncher5.GetInstance().buffetList.Add(bulletObject);

            if (hit)
            {
                Debug.LogError("大众敌人了-1@" + info.collider.transform.name);
                // 判断是否射中Tag为enemy的物体
                if (info.collider.transform.tag.Equals("EnemyPhy"))
                {
                    Debug.LogError("大众敌人了1");
                    AI3DPlayer aIPlayer = info.transform.GetComponent <AI3DPlayer>();
                    if (aIPlayer.belongGroup != belongGroup)
                    {
                        aIPlayer.hp = aIPlayer.hp - 20;
                        Debug.LogError("大众敌人了2");
                    }
                    // 敌人减少生命
                    //info.transform.GetComponent<Enemy>().OnDamage(1);
                    //                    Instantiate(fx, info.point, info.transform.rotation);
                }
                //            }
                // 在射中的地方释放一个粒子效果

                Debug.Log(info.point);
            }
        }

        //装填子弹
    }