示例#1
0
 void OnMouseOver()
 {
     if (Input.GetMouseButtonUp(0))
     {
         GeneralUnitsController.CleanSelections();
         SendMessage("OnSelect");
         UnitInfoPanel.Instance.ShowUnitInfo(this);
     }
     if (Input.GetMouseButtonUp(1))
     {
         GeneralUnitsController.Attack(this);
     }
 }
示例#2
0
 void Update()
 {
     if (Input.GetMouseButtonUp(0) && GeneralUnitsController.Selection.width > 0 && GeneralUnitsController.Selection.height > 0)
     {
         Vector3 camPos = Camera.main.WorldToScreenPoint(transform.position);
         camPos.y   = GeneralUnitsController.ScreenToRectY(camPos.y);
         IsSelected = GeneralUnitsController.Selection.Contains(camPos);
         if (IsSelected)
         {
             SendMessage("OnSelect");
         }
         else
         {
             SendMessage("OnUnselect");
         }
     }
 }
 void Awake()
 {
     Instance = this;
 }
 void Awake()
 {
     Instance = this;
 }