public void Emigration(PlanetBase target) { this.mainPlanet = target; for (int i = 0; i < mainPlanet.transform.parent.childCount; i++) { if (mainPlanet.transform.parent.GetChild(i) != mainPlanet.transform) { mainPlanet.transform.parent.GetChild(i).SetParent(null); i--; } } sectorMgr.OnEmigration(target.transform.parent.GetComponent <Sector>().nowSectorTile.index - 1); if (target.canSurvive) { currentHp = maxHp; } else { currentHp -= 10; } um.EmigrationEffect(target.canSurvive); }