Esempio n. 1
0
    public static void LeftClick(Vector3 startingMousePosition, Vector3 endingMousePosition, RaycastHit hit)
    {
        //click
        if (startingMousePosition == endingMousePosition)
        {
            switch (hit.transform.gameObject.layer)
            {
            case unitLayer:
                PlayerUnits.DeselectAll();
                PlayerUnits.SingleSelect(hit.collider.gameObject);
                break;

            case movableLayer:
                PlayerUnits.MoveSelected(hit.point);
                break;

            case buildingLayer:
                PlayerBuildings.Select(hit.collider.gameObject);
                break;

            default:
                break;
            }
        }
        //drag
        else
        {
            PlayerUnits.BoxSelect(startingMousePosition);
        }
    }
Esempio n. 2
0
 public static void RightClick()
 {
     PlayerUnits.DeselectAll();
     PlayerBuildings.Deselect();
 }