public void MoveUp() { ec.RemoveCreepFromEnemyList(this); linePosition -= 1; sprite.sortingOrder = linePosition; creepTransform.position = new Vector3(creepTransform.position.x, creepTransform.position.y + Constants.CELL_HEIGHT, creepTransform.position.z); ec.AddCreepToEnemyList(this); GetMainTower(); }
private void Start() { GameEvents.current.OnTowerAppear += GetClosestTower; oh = ObjectsHolder.Instance; xpPoints = oh.xpPoints; hp_norm = 1f; startHp = hitPoints; ec = oh.enemyController; SetBullet(); healthBarGO.SetActive(false); DisplaceZPosition(); // to prevent flicking ec.AddCreepToEnemyList(this); GetMainTower(); GetClosestTower(); }