Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        private void OnTravelersReachDestination(Traveler traveler, Village desitination)
        {
            desitination.OnTravelerArrive(traveler);

            _travelers.Remove(traveler);
        }