private void initializeInactiveIsland() { activeIsland.SetActive(false); inactiveIsland.SetActive(true); durability = 0; m_condition = IslandCondition.DESTROYED; }
private void initializeActiveIsland() { activeIsland.SetActive(true); inactiveIsland.SetActive(false); durability = MAX_DURABILITY; m_condition = IslandCondition.CREATED; }
public void damaged() { if (playerHere) { Icon.transform.position = Camera.main.WorldToScreenPoint(transform.position + IconOffset); } m_condition = IslandCondition.DAMAGED; IslandDamaged.Invoke(); //todo: change Island Texture }
public void destroy() { if (!playerHere) { inactiveIsland.SetActive(true); activeIsland.SetActive(false); m_condition = IslandCondition.DESTROYED; foreach (Island nearbyIsland in nearbyIslands) { nearbyIsland.onNearbyIslandDestroy(); } IslandDestroyed.Invoke(); } else { } }
public void destroy() { if (playerHere) { //todo: 传送player 回家,写日记并开始新的一天 PlayerRespawn respawn = FindObjectOfType <PlayerRespawn>(); respawn.respawn(); //attr.gameObject.transform.position = GameEvents.Sigton.onTheDestroyedIsland.Invoke(); } inactiveIsland.SetActive(true); activeIsland.SetActive(false); m_condition = IslandCondition.DESTROYED; foreach (Island nearbyIsland in nearbyIslands) { nearbyIsland.onNearbyIslandDestroy(); } IslandDestroyed.Invoke(); }
public void damaged() { m_condition = IslandCondition.DAMAGED; IslandDamaged.Invoke(); //todo: change Island Texture }
//completely repair the island. //need to check and find out how many resources need for repairing public void repair() { durability = 100; m_condition = IslandCondition.CREATED; //todo: change Island Texture }