public void OnEventHandle(ReferenceAndEventDemo.Event param) { if (param is ClickedShopTabEvent clickedShopTab) { model.ChangedShopTab(clickedShopTab.ClickedShopTab); } else if (param is DestroyedShop && shopDisposable != null) { shopDisposable.Dispose(); } }
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(); } }
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()); } } }