void Start() { // Simple Billborad rb = GetComponent <Rigidbody2D>(); pawn = GetComponent <PawnState>(); renderBody = transform.Find("Body")?.GetComponent <SpriteRenderer>(); renderHead = transform.Find("Head")?.GetComponent <SpriteRenderer>(); transArrow = transform.Find("Arrow"); }
public void DestoryPawn(PawnState pawn) { if (pawn is EnemyState) { var item = enemyList.Find(it => it == pawn); enemyList.Remove(item); } else if (pawn is HeroState) { hero = null; } GameObject.Destroy(pawn.gameObject); }
public void GameFailCallBack(PawnState _) { Time.timeScale = 0f; failMenu.gameObject.SetActive(true); }