Exemplo n.º 1
0
 private void initializeInactiveIsland()
 {
     activeIsland.SetActive(false);
     inactiveIsland.SetActive(true);
     durability  = 0;
     m_condition = IslandCondition.DESTROYED;
 }
Exemplo n.º 2
0
 private void initializeActiveIsland()
 {
     activeIsland.SetActive(true);
     inactiveIsland.SetActive(false);
     durability  = MAX_DURABILITY;
     m_condition = IslandCondition.CREATED;
 }
Exemplo n.º 3
0
 public void damaged()
 {
     if (playerHere)
     {
         Icon.transform.position = Camera.main.WorldToScreenPoint(transform.position + IconOffset);
     }
     m_condition = IslandCondition.DAMAGED;
     IslandDamaged.Invoke();
     //todo: change Island Texture
 }
Exemplo n.º 4
0
 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
     {
     }
 }
Exemplo n.º 5
0
 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();
 }
Exemplo n.º 6
0
 public void damaged()
 {
     m_condition = IslandCondition.DAMAGED;
     IslandDamaged.Invoke();
     //todo: change Island Texture
 }
Exemplo n.º 7
0
 //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
 }