Beispiel #1
0
    public void showUnits(int parm, int check)
    {
        bool b = false;

        GameBattleMan[] Man   = GameBattleManager.instance.ActiveBattleStage.Man;
        GameBattleStage stage = GameBattleManager.instance.ActiveBattleStage;

        for (int i = 0; i < Man.Length; i++)
        {
            GameBattleMan man = Man[i];

            if (man.EventParm1 == parm)
            {
                GameBattleUnit unit = GameBattleUnitManager.instance.getUnit(i);

                //                 if ( unit.IsKilled )
                //                 {
                //                     unit.initHPMP();
                //                     GameBattleXY xy = stage.XY[ i ];
                //                     unit.setPos( xy.X , xy.Y );
                //                 }

                if (unit.IsAlive)
                {
                    unit.setPos(stage.XY[unit.BattleManID].X, stage.XY[unit.BattleManID].Y);
                }

                GameUnitMove unitMove = GameUnitMoveTypeData.instance.getData(unit.MoveType);

                GameBattleUnit unit1 = GameBattleUnitManager.instance.getUnit(unit.PosX, unit.PosY);

                if (check == 1 &&
                    unit != unit1 &&
                    unit1 != null)
                {
                    GameBattlePathFinder.instance.findNearPos(unit.PosX, unit.PosY, unitMove.block);

                    unit.setPos(GameBattlePathFinder.instance.nearPosX,
                                GameBattlePathFinder.instance.nearPosY);
                }

                if (check == 1 &&
                    GameBattlePathFinder.instance.isBlockPos(unit.PosX, unit.PosY, unitMove.block, unit))
                {
                    GameBattlePathFinder.instance.findNearPos(unit.PosX, unit.PosY, unitMove.block);

                    unit.setPos(GameBattlePathFinder.instance.nearPosX,
                                GameBattlePathFinder.instance.nearPosY);
                }

                unit.IsShow = true;
                //                            unit.IsActed = true;

                if (unit.IsKilled)
                {
                    unit.IsKilled = false;
                    unit.setAlpha(1.0f);
                    unit.gameObject.SetActive(true);
                }


                unit.updateAlive();
                unit.playAnimationBattle(GameAnimationType.Stand,
                                         GameAnimationDirection.South, null);
                unit.updateInteam();

//                 if ( !b && GameBattleTurn.instance.Turn > 1 )
//                 {
//                     if ( GameUserData.instance.Stage == 12 && parm == 4 )
//                     {
//                         // stage 12 bug
//                         continue;
//                     }
//
//                     b = true;
//
//                     GameBattleCursor.instance.show();
//                     GameBattleCursor.instance.moveTo( unit.PosX , unit.PosY ,
//                                     GameBattleCursor.SpeedX , GameBattleCursor.SpeedY ,
//                                      onShowUnitOver );
//                 }
            }
        }

        GameBattleUnitManager.instance.resetEnemyAI();

        if (!b)
        {
            onShowUnitOver();
        }
    }