예제 #1
0
 void allSoldierOnGroundFindPath()
 {
     for (int i = 0; i < soldierPool.live.Count; i++)
     {
         ASoldier soldier = soldierPool.live[i] as ASoldier;
         if (soldier.mSoldierBody.state == ASoldierBody.State_Walking ||
             soldier.mSoldierBody.state == ASoldierBody.State_Climbing ||
             soldier.mSoldierBody.state == ASoldierBody.State_Jumping)
         {
             soldier.pathFind();
         }
     }
 }
예제 #2
0
    public override void collideAction(ContactInfo contactInfo)
    {
        if (contactInfo.other is ABullet)
        {
            if (state == State_Normal)
            {
                if (parachute.state == AParachute.State_UnOpen)
                {
                    parachute.Action_fall();
                }
                Action_dieInAir();
            }
            else if (state == State_Walking)
            {
                Action_DieOnGround();
            }
            else if (state == State_Climbing)
            {
                Action_DieOnGround();
            }
            else if (state == State_AliveButFalling)
            {
                Action_dieInAir();
            }
            else if (state == State_DieInAir)
            {
                if (parachute.state == AParachute.State_OpenComplete)
                {
                    parachute.Action_fall();
                }
            }
        }
        else if (contactInfo.other is ABlock)
        {
            soldier.cancelTestBlock();



            if (state == State_Normal)
            {
                if (Player.isFailure == true)
                {
                    parachute.Action_BackToBag();
                    Action_Cheer();
                    return;
                }
                else
                {
                    if (contactInfo.other is AFloor)
                    {
                        parachute.Action_BackToBag();
                        Action_Walking();
                        soldier.pathFind();
                        soldier.beginTestPath();
                    }
                    else if (contactInfo.other is GunTowerBase)
                    {
                        parachute.Action_BackToBag();
                        soldier.Action_PlayerFailure();
                    }
                }
            }
            else if (state == State_DieInAir)
            {
                parachute.Action_BackToBag();
                Action_LandOnGoundDead();
            }
            else if (state == State_AliveButFalling)
            {
                Action_LandOnGoundDead();
            }
        }
    }