public override void Initial()
    {
        if (!this.CharacterAI.BattleMapData.ActorCanPass(this.m_CurrentPosition.Row, this.m_CurrentPosition.Column))
        {
            TilePosition tp = this.CharacterAI.PreviousValidPosition;
            if (tp == null)
            {
                GameObject target = this.CharacterAI.BattleSceneHelper.GetNearestBuildingOfCategory(this.m_AIBehavior.transform.position, this.CharacterAI.FavoriteCategory);
                if (target != null)
                {
                    BuildingBasePropertyBehavior property = target.GetComponent <BuildingBasePropertyBehavior>();
                    tp = property.GetBuildingFirstActorPosition();
                }
            }

            if (tp != null)
            {
                InvaderFindOutState findOutState = new InvaderFindOutState(this.CharacterAI.BattleMapData, tp, this.m_AIBehavior);
                this.m_AIBehavior.ChangeState(findOutState);
            }
        }
        else
        {
            this.CharacterAI.PreviousValidPosition = this.m_CurrentPosition;
        }
        base.Initial();
    }
    private void SetNoWallBuildingToTarget()
    {
        foreach (GameObject item in this.m_TargetsObjects)
        {
            if (item != null)
            {
                BuildingBasePropertyBehavior property = item.GetComponent <BuildingBasePropertyBehavior>();
                TilePosition destination = property.GetBuildingFirstActorPosition();
                IgnoreTargetAndAttackScopeWeightStrategy findPathStrategy = new IgnoreTargetAndAttackScopeWeightStrategy(
                    this.CharacterAI.BattleMapData, destination.Row, destination.Column, this.CharacterAI.AttackBehavior.AttackScope);
                //KodoPathFindStrage findPathStrategy = new KodoPathFindStrage(
                //	this.CharacterAI.BattleMapData, destination.Row, destination.Column);

                List <TilePosition> aStarPath;
                List <TilePosition> linePath = AStarPathFinder.CalculatePathTile(findPathStrategy, this.CharacterAI.BattleMapData.ActorObstacleArray,
                                                                                 this.m_CurrentPosition, destination, out aStarPath);

                TilePosition endPoint       = linePath[linePath.Count - 1];
                GameObject   targetBuilding = this.CharacterAI.BattleMapData.GetBulidingObjectFromActorObstacleMap(endPoint.Row, endPoint.Column);
                if (targetBuilding != null)
                {
                    property = targetBuilding.GetComponent <BuildingBasePropertyBehavior>();
                    if (property != null)
                    {
                        if (BattleEffectConfig.Instance.TargetEffectPrefab != null && this.CharacterAI.IsShowTarget)
                        {
                            GameObject targetEffect = GameObject.Instantiate(BattleEffectConfig.Instance.TargetEffectPrefab) as GameObject;
                            Vector3    offset       = targetEffect.transform.position;

                            Vector3 targetEffectPosition = property.AnchorTransform.position;
                            targetEffect.transform.position = targetEffectPosition + offset;
                            targetEffect.transform.parent   = BattleObjectCache.Instance.EffectObjectParent.transform;
                        }

                        BombermanWalkState walkState = new BombermanWalkState(this.CharacterAI.BattleMapData, endPoint, this.m_AIBehavior, targetBuilding);
                        walkState.SetPath(linePath);
                        this.m_AIBehavior.ChangeState(walkState);
                        break;
                    }
                }
            }
        }
    }