Example #1
0
 protected override void finishPathUnit()
 {
     if (heroState == HeroState.ToCrime)
     {
         if (currentFocusedCrime.GetIsActive())
         {
             if (crimeManager.OnCrimeScene(currentTile, currentFocusedCrime.tiles))
             {
                 currentFocusedCrime.AddHeroToScene(hero);
                 SetHeroState(HeroState.Fighting);
             }
             else
             {
                 // if somehow finished on wrong tile, reroute to the actual crime tile
                 GoToTile(crimeManager.GetCrimeInRange(currentTile, currentFocusedCrime.tiles).closestTile);
             }
         }
         else
         {
             // if crime already not active, go back to patrol
             currentFocusedCrime = null;
             SetHeroState(HeroState.Patrol);
             StopPath();
         }
     }
 }
Example #2
0
    protected override void finishPathUnit()
    {
        if (villainState == VillainState.ToCrime)
        {
            if (crimeManager.OnCrimeScene(currentTile, currentFocusedCrime.tiles))
            {
                if (currentFocusedCrime != null && !currentFocusedCrime.crimeStarted)
                {
                    crimeManager.StartCrime(currentFocusedCrime);
                }

                SetVillainState(VillainState.Criming);
            }
            else
            {
                // if somehow finished on wrong tile, reroute to the actual crime tile
                GoToTile(crimeManager.GetCrimeInRange(currentTile, currentFocusedCrime.tiles).closestTile);
            }
        }
    }