public override void Enter() { base.Enter(); gameobject = prefabMng.GetCreature(); gameobject.SetActive(true); UnitCard card = gameobject.GetComponent <UnitCard>(); if (card != null) { card.type = UnitType.creature; card.unit = this; } else { Debug.Log("CreatureUnit:::gamobject has no unitcard"); } foreach (var com in coms) { com.OnEnter(gameobject); } }