Exemple #1
0
 public static void TryMarkShip(string tag)
 {
     if (tag.StartsWith("ShipId:"))
     {
         TryUnmarkPreviousHoveredShip();
         HoveredShip = Roster.AllShips[tag];
         if ((HoveredShip != ThisShip) && (HoveredShip != AnotherShip))
         {
             HoveredShip.HighlightAnyHovered();
             Roster.MarkShip(HoveredShip, Color.yellow);
         }
     }
     else
     {
         TryUnmarkPreviousHoveredShip();
     }
 }
Exemple #2
0
    private static void TryMarkShip()
    {
        RaycastHit hitInfo = new RaycastHit();

        if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hitInfo))
        {
            if (hitInfo.transform.tag.StartsWith("ShipId:"))
            {
                TryUnmarkPreviousHoveredShip();
                HoveredShip = Roster.AllShips[hitInfo.transform.tag];
                if ((HoveredShip != ThisShip) && (HoveredShip != AnotherShip))
                {
                    HoveredShip.HighlightAnyHovered();
                    Roster.MarkShip(HoveredShip, Color.yellow);
                }
            }
            else
            {
                TryUnmarkPreviousHoveredShip();
            }
        }
    }