コード例 #1
0
 //событие точки - PointerDown
 public void PlayerPointDown(Image point_image, PointInfo s_point)
 {
     if (s_point.GetPointStatus())
     {
         return;
     }
     if (selected_unit != null)
     {
         selected_unit.PlayerChosePoint(s_point, point_image.transform);
         PlayerDeselectUnit();
         return;
     }
     current_point     = s_point;
     point_image.color = Color.white;//непрозрачный яркий
     player_menu.transform.position = main_camera.GetComponent <Camera>().WorldToScreenPoint(point_image.transform.position);
     player_menu.SetActive(!player_menu.activeSelf);
 }
コード例 #2
0
 //событие точки - PointerUp
 public void PlayerPointUp(Image point_image)
 {
     if (current_point == null)
     {
         return;
     }
     point_image.color = new Color(1f, 1f, 1f, 0.4f);//прозрачный тусклый
     //+++
     if (selected_unit == null && !current_point.GetPointStatus())
     {
         player_menu.SetActive(!player_menu.activeSelf);
         if (current_button_index > 0 && CheckPlayerLP(player_unit_cost[current_button_index - 1]))
         {
             selected_unit = game_controller.GetUnitInPool((byte)(current_button_index - 1), true, Vector3.zero) as EarthUnit;//временно - отключаем др. кнопки!
             DeselectButton(player_menu.transform.GetChild(current_button_index - 1).GetComponent <Image>());
             selected_unit.PlayerChosePoint(current_point, point_image.transform);
             player_lp -= player_unit_cost[selected_unit.unit_type - 1]; //+++
             RefreshGameInterface(2, 0);                                 //+++
         }
     }
     selected_unit = null;
     current_point = null;
 }