コード例 #1
0
 private void LateUpdate()
 {
     if (GetActiveActivity().Count > 0)
     {
         Game             game             = Game.GetInstantiate();
         InterfaceManager interfaceManager = InterfaceManager.GetInstantiate();
         MapManager       mapManager       = MapManager.GetInstantiate();
         label.gameObject.SetActive(true);
         label.transform.LookAt(Camera.main.transform);
         labelTime += Time.deltaTime;
         if (labelTime > mapManager.pointLabelTime)
         {
             curLabelIndex++;
             labelTime = 0;
         }
         if (curLabelIndex >= GetActiveActivity().Count)
         {
             curLabelIndex = 0;
         }
         if (GetActiveActivity()[curLabelIndex] is Office)
         {
             if (mouseover)
             {
                 label.sprite = mapManager.overOfficeSprite;
             }
             else
             {
                 label.sprite = mapManager.officeSprite;
             }
         }
         else if (GetActiveActivity()[curLabelIndex] is DetectiveHome)
         {
             if (mouseover)
             {
                 label.sprite = mapManager.overHomeSprite;
             }
             else
             {
                 label.sprite = mapManager.homeSprite;
             }
         }
         else if (GetActiveActivity()[curLabelIndex] is QuestEvent)
         {
             if (mouseover)
             {
                 label.sprite = mapManager.eventOverSprite;
             }
             else
             {
                 label.sprite = mapManager.eventSprite;
             }
         }
         if (game.GetGameState() == GameState.IN_GAME || game.GetGameState() == GameState.WAIT_ACTIVITY_CHOICE)
         {
             if (mouseover != showRollover)
             {
                 showRollover = mouseover;
                 if (showRollover)
                 {
                     interfaceManager.activitiesRollover.Show(GetActiveActivity(), Camera.main.WorldToScreenPoint(transform.position));
                 }
                 else
                 {
                     interfaceManager.activitiesRollover.Hide();
                 }
             }
         }
         else
         {
             if (mouseover && showRollover)
             {
                 showRollover = false;
                 interfaceManager.activitiesRollover.Hide();
             }
         }
     }
     else
     {
         label.gameObject.SetActive(false);
     }
 }