コード例 #1
0
 void OnMouseClick(PointerEventData data)
 {
     if (data.button == PointerEventData.InputButton.Right)
     {
         cController.dismiss(index);
         active = false;
         cController.selectedCrew.Remove(cMember);
     }
     if (data.button == PointerEventData.InputButton.Left)
     {
         // Debug.Log("Toggle");
         if (active)
         {
             active          = !active;
             CrewIcon.count -= 1;
             Color x = new Color();
             ColorUtility.TryParseHtmlString("#373737", out x);
             image.color = x;
             cController.selectedCrew.Remove(cMember);
         }
         else
         {
             if (CrewIcon.count < CrewIcon.maxCount)
             {
                 CrewIcon.count += 1;
                 active          = !active;
                 Color newColor = new Color();
                 ColorUtility.TryParseHtmlString("#FFBC7C", out newColor);
                 image.color = newColor;
                 cController.selectedCrew.Add(cMember);
             }
         }
         Debug.Log(cController.selectedCrew.Count);
     }
 }