public void OnEventHandle(ReferenceAndEventDemo.Event param)
 {
     if (param is ClickedShopTabEvent clickedShopTab)
     {
         model.ChangedShopTab(clickedShopTab.ClickedShopTab);
     }
     else if (param is DestroyedShop && shopDisposable != null)
     {
         shopDisposable.Dispose();
     }
 }
Example #2
0
 public void OnEventHandle(ReferenceAndEventDemo.Event param)
 {
     if (param is LaidEggsEvent laidEggs)
     {
         var eggIncubateAnimal = GetComponent <EggIncubateAnimal>();
         eggIncubateAnimal.RequestIncubate(laidEggs.EggsCount);
     }
     else if (param is IncubatedEggsEvent incubatdEggs)
     {
         GetComponent <LayEggAnimal>().RequestGiveBirth();
     }
 }
Example #3
0
 public void OnEventHandle(ReferenceAndEventDemo.Event param)
 {
     if (param is LaidEggsEvent laidEggs)
     {
         var eggIncubateAnimal = GetComponent <EggIncubateAnimal>();
         eggIncubateAnimal.RequestIncubate(laidEggs.EggsCount);
     }
     else if (param is IncubatedEggsEvent incubatedEggs)
     {
         var nursingAnimal = GetComponent <NursingAnimal>();
         for (var i = 0; i < incubatedEggs.EggsCount; ++i)
         {
             nursingAnimal.RequestNursing(new NursingBaby());
         }
     }
 }