public DISTANCE GetDistance(float distanceSqr)
    {
        BrainParam.SensorParam sensorParam = brain.param.sensorParam;
        float num  = sensorParam.shortDistance * sensorParam.shortDistance;
        float num2 = sensorParam.middleDistance * sensorParam.middleDistance;
        float num3 = sensorParam.longDistance * sensorParam.longDistance;

        if (distanceSqr < num)
        {
            return(DISTANCE.SHORT_SHORT);
        }
        if (distanceSqr >= num && distanceSqr < num2)
        {
            return(DISTANCE.SHORT);
        }
        if (distanceSqr >= num2 && distanceSqr < num3)
        {
            return(DISTANCE.MIDDLE);
        }
        return(DISTANCE.LONG);
    }
    public void Update()
    {
        //IL_003b: Unknown result type (might be due to invalid IL or missing references)
        //IL_0040: Unknown result type (might be due to invalid IL or missing references)
        //IL_004c: Unknown result type (might be due to invalid IL or missing references)
        //IL_0051: Unknown result type (might be due to invalid IL or missing references)
        BrainParam.SensorParam sensorParam = brain.param.sensorParam;
        Character owner          = brain.owner;
        Vector2   owner_pos2     = owner.positionXZ;
        Vector2   owner_forward2 = owner.forwardXZ;

        counter.Clear();
        bool        isAutoMode        = false;
        TargetPoint actionTargetPoint = null;

        if (brain.owner is Self)
        {
            Self self = brain.owner as Self;
            isAutoMode = self.isAutoMode;
            if (isAutoMode)
            {
                AutoSelfController autoSelfController = self.controller as AutoSelfController;
                actionTargetPoint = autoSelfController.actionTargetPoint;
            }
        }
        List <StageObject> targetObjectList = brain.GetTargetObjectList();

        targetObjectList.ForEach(delegate(StageObject opponent_obj)
        {
            //IL_0045: Unknown result type (might be due to invalid IL or missing references)
            //IL_004a: Unknown result type (might be due to invalid IL or missing references)
            //IL_0050: Unknown result type (might be due to invalid IL or missing references)
            //IL_0055: Unknown result type (might be due to invalid IL or missing references)
            //IL_0072: Unknown result type (might be due to invalid IL or missing references)
            //IL_007e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0083: Unknown result type (might be due to invalid IL or missing references)
            //IL_0088: Unknown result type (might be due to invalid IL or missing references)
            //IL_008a: Unknown result type (might be due to invalid IL or missing references)
            //IL_008d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0092: Unknown result type (might be due to invalid IL or missing references)
            //IL_0097: Unknown result type (might be due to invalid IL or missing references)
            //IL_0099: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a6: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ab: Unknown result type (might be due to invalid IL or missing references)
            //IL_00b0: Unknown result type (might be due to invalid IL or missing references)
            //IL_00d1: Unknown result type (might be due to invalid IL or missing references)
            //IL_00d6: Unknown result type (might be due to invalid IL or missing references)
            //IL_00e5: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ea: Unknown result type (might be due to invalid IL or missing references)
            //IL_0351: Unknown result type (might be due to invalid IL or missing references)
            //IL_0356: Unknown result type (might be due to invalid IL or missing references)
            //IL_0383: Unknown result type (might be due to invalid IL or missing references)
            //IL_0388: Unknown result type (might be due to invalid IL or missing references)
            //IL_038a: Unknown result type (might be due to invalid IL or missing references)
            //IL_038c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0392: Unknown result type (might be due to invalid IL or missing references)
            //IL_0397: Unknown result type (might be due to invalid IL or missing references)
            //IL_039c: Unknown result type (might be due to invalid IL or missing references)
            //IL_03e2: Unknown result type (might be due to invalid IL or missing references)
            //IL_03e7: Unknown result type (might be due to invalid IL or missing references)
            //IL_03e9: Unknown result type (might be due to invalid IL or missing references)
            //IL_03eb: Unknown result type (might be due to invalid IL or missing references)
            //IL_03f1: Unknown result type (might be due to invalid IL or missing references)
            //IL_03f6: Unknown result type (might be due to invalid IL or missing references)
            //IL_03fb: Unknown result type (might be due to invalid IL or missing references)
            //IL_0408: Unknown result type (might be due to invalid IL or missing references)
            //IL_042c: Unknown result type (might be due to invalid IL or missing references)
            //IL_042f: Unknown result type (might be due to invalid IL or missing references)
            //IL_043f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0444: Unknown result type (might be due to invalid IL or missing references)
            //IL_0446: Unknown result type (might be due to invalid IL or missing references)
            //IL_044b: Unknown result type (might be due to invalid IL or missing references)
            //IL_044e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0453: Unknown result type (might be due to invalid IL or missing references)
            Character character = opponent_obj as Character;
            if (!(character != null) || !character.isDead)
            {
                OpponentRecord opponentRecord = FindOrRegist(opponent_obj);
                bool flag = opponentRecord.record != null;
                Vector3 client_pos;
                if (flag)
                {
                    client_pos = opponentRecord.record.pos;
                }
                else
                {
                    client_pos            = Vector3.get_zero();
                    opponentRecord.record = new RecordData();
                }
                RecordData record    = opponentRecord.record;
                record.pos           = owner.GetTargetPosition(opponent_obj);
                Vector2 val          = record.pos.ToVector2XZ();
                Vector2 p            = val - owner_pos2;
                Vector2 p2           = val - brain.frontPositionXZ;
                record.distance      = p.get_magnitude();
                record.distanceFront = p2.get_magnitude();
                record.rootAngle     = Utility.Angle360(owner_forward2, p);
                record.frontAngle    = Utility.Angle360(owner_forward2, p2);
                record.isView        = false;
                if (record.distanceFront <= sensorParam.viewDistance)
                {
                    float num = (record.frontAngle + sensorParam.viewAngle / 2f) % 360f;
                    if (num < sensorParam.viewAngle)
                    {
                        record.isView = true;
                        counter.viewNum++;
                    }
                }
                record.place = AIUtility.GetPlaceOfAngle360(record.rootAngle);
                switch (record.place)
                {
                case PLACE.RIGHT:
                    counter.rightNum++;
                    break;

                case PLACE.LEFT:
                    counter.leftNum++;
                    break;

                case PLACE.FRONT:
                    counter.frontNum++;
                    break;

                case PLACE.BACK:
                    counter.backNum++;
                    break;
                }
                record.isNearPlace = false;
                if (record.distance <= sensorParam.nearCheckDistance)
                {
                    record.isNearPlace = true;
                    counter.nearNum++;
                }
                float num2 = record.distance - brain.rootInternalRedius;
                switch (record.place)
                {
                case PLACE.FRONT:
                    num2 -= brain.rootFrontDistance;
                    break;

                case PLACE.BACK:
                    num2 -= brain.rootBackDistance;
                    break;
                }
                if (num2 < sensorParam.shortDistance)
                {
                    record.distanceType = DISTANCE.SHORT_SHORT;
                }
                else if (num2 >= sensorParam.shortDistance && num2 < sensorParam.middleDistance)
                {
                    record.distanceType = DISTANCE.SHORT;
                }
                else if (num2 >= sensorParam.middleDistance && num2 < sensorParam.longDistance)
                {
                    record.distanceType = DISTANCE.MIDDLE;
                }
                else
                {
                    record.distanceType = DISTANCE.LONG;
                }
                Vector3 val2            = record.pos;
                float attackPosDistance = record.distance;
                if (isAutoMode)
                {
                    if (actionTargetPoint != null)
                    {
                        val2              = actionTargetPoint.GetTargetPoint();
                        Vector2 val3      = val2.ToVector2XZ() - owner_pos2;
                        attackPosDistance = val3.get_magnitude();
                    }
                }
                else if (owner is Player)
                {
                    Player player = owner as Player;
                    if (player.targetingPoint != null)
                    {
                        val2              = player.targetingPoint.GetTargetPoint();
                        Vector2 val4      = val2.ToVector2XZ() - owner_pos2;
                        attackPosDistance = val4.get_magnitude();
                    }
                }
                record.attackPos         = val2;
                record.attackPosDistance = attackPosDistance;
                record.moveLength        = 0f;
                if (flag)
                {
                    record.moveLength = AIUtility.GetLengthWithBetweenPosition(client_pos, record.pos);
                }
                Vector2 p3             = owner_pos2 - val;
                float angle            = Utility.Angle360(opponent_obj.forwardXZ, p3);
                record.placeOfOpponent = AIUtility.GetPlaceOfAngle360(angle);
            }
        });
    }