protected void DestroyUnit() { if (_factory != null) { _factory.Free(this.gameObject); } else { Destroy(this.gameObject); } }
public void FreeItemView(ItemView itemView) { switch (itemView.item.type) { case Item.EItemType.FLOWER: _flowerFactory.Free(itemView.gameObject); break; case Item.EItemType.COIN: _coinFactory.Free(itemView.gameObject); break; case Item.EItemType.QUEST_ITEM: _questItemFactory.Free(itemView.gameObject); break; } }
public void Free(GameObject face, Enemy.EEnemyType type) { switch (type) { case Enemy.EEnemyType.GIRL: _girlFace.Free(face); break; case Enemy.EEnemyType.GRANNY: _grannyFace.Free(face); break; case Enemy.EEnemyType.TRADER: _traderFace.Free(face); break; case Enemy.EEnemyType.CONDUCTOR: _conductorFace.Free(face); break; } }