예제 #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");
         }
     }
 }
예제 #3
0
 void Awake()
 {
     Instance = this;
 }
예제 #4
0
 void Awake()
 {
     Instance = this;
 }