public void CreateTravler(Village originate, Village desitination, int health_population, int infect_population, DiseaseSO carryDisease) { if (spritePackerSo == null) { return; } var travelObject = UtilityMethod.CreateObjectToParent(travelerHolders.transform, travelerPrefab.gameObject); Traveler traveler = travelObject.GetComponent <Traveler>(); Sprite RandomSprite = spritePackerSo.FindSpriteByRandom(); int timeCost = Random.Range(2, 5); traveler.SetTraveler(health_population, infect_population, RandomSprite, desitination, originate, carryDisease, timeCost, OnTravelersReachDestination); _travelers.Add(traveler); }
private void OnTravelersReachDestination(Traveler traveler, Village desitination) { desitination.OnTravelerArrive(traveler); _travelers.Remove(traveler); }