Ejemplo n.º 1
0
 public virtual void OnInputClicked(InputClickedEventData eventData)
 {
     // On each tap gesture, toggle whether the user is in placing mode.
     IsBeingPlaced = !IsBeingPlaced;
     HandlePlacement();
     eventData.Use();
 }
Ejemplo n.º 2
0
 public void OnInputClicked(InputClickedEventData eventData)
 {
     button.Selected             = false;
     button.Focused              = false;
     answerText.text             = String.Format(fixedPhrase, choiceText.text);
     AnswerManager.currentAnswer = choiceText.text;
     eventData.Use();
 }
Ejemplo n.º 3
0
 public void OnInputClicked(InputClickedEventData eventData)
 {
     if (IsEnabled)
     {
         ButtonPressed.RaiseEvent();
         eventData.Use(); // Mark the event as used, so it doesn't fall through to other handlers.
     }
 }
Ejemplo n.º 4
0
        public void OnInputClicked(InputClickedEventData eventData)
        {
            foreach (var choiceDescription in choiceDescriptions)
            {
                choiceDescription.SetActive(true);
            }

            eventData.Use();
        }
Ejemplo n.º 5
0
 public void OnInputClicked(InputClickedEventData eventData)
 {
     positionDeterminer.Arrange(MaterialManager.GetMaterial(AnswerManager.currentAnswer));
     panelManager.isVoted = true;
     notPolledUI.SetActive(false);
     polledUI.SetActive(true);
     RatioManager.UpdateRatio(AnswerManager.currentAnswer);
     eventData.Use();
 }
Ejemplo n.º 6
0
        //  public AudioSource audioS;

        public void OnInputClicked(InputClickedEventData eventData)
        {
            // audioS = GetComponent<AudioSource>();
            // Increase the scale of the object just as a response.
            //  gameObject.transform.localScale -= 0.9f * gameObject.transform.localScale;
            Instantiate(particle, transform.position, transform.rotation);

            //  audioS.Play();
            Destroy(gameObject);
            eventData.Use(); // Mark the event as used, so it doesn't fall through to other handlers.
        }
Ejemplo n.º 7
0
        public void OnInputClicked(InputModule.InputClickedEventData eventData)
        {
            GameObject targeted = InputModule.FocusManager.Instance.TryGetFocusedObject(eventData);

            foreach (KeyValuePair <string, GameObject> b in buttons)
            {
                if (targeted == b.Value)
                {
                    switch (b.Key)
                    {
                    case "MoveWithMe":
                        MoveWithMe = !MoveWithMe;
                        break;

                    case "DepthDebug":
                        DepthDebug = !DepthDebug;
                        break;

                    case "ShowCursor":
                        ShowCursor = !ShowCursor;
                        break;

                    case "AutoDistance":
                        if (CaptionDistance == 0)
                        {
                            CaptionDistance = 1;
                        }
                        else if (CaptionDistance == 1)
                        {
                            CaptionDistance = 2;
                        }
                        else if (CaptionDistance == 2)
                        {
                            CaptionDistance = 4;
                        }
                        else if (CaptionDistance == 4)
                        {
                            CaptionDistance = 8;
                        }
                        else
                        {
                            CaptionDistance = 0;
                        }
                        break;

                    case "TextSize":
                        TextSize = (TextSize + 1) % 3;
                        break;

                    case "TextLines":
                        TextLines = (TextLines % 5) + 1;
                        break;

                    case "TextLineLength":
                        TextLineLength += 20;
                        if (TextLineLength > 80)
                        {
                            TextLineLength = 40;
                        }
                        break;
                    }

                    settings_set = false;

                    eventData.Use();
                    return;
                }
            }


            if (captions.Count > 1)
            {
                for (int i = captions.Count - 1; i >= 0; i--)
                {
                    GameObject o = captions[i];
                    if (o.GetComponent <GlassEarTagalong>().frozen&& targeted == o)
                    {
                        captions.RemoveAt(i);
                        Destroy(o);

                        eventData.Use();
                        return;
                    }
                }
            }

            foreach (GameObject o in captions)
            {
                if (!o.GetComponent <GlassEarTagalong>().frozen)
                {
                    o.GetComponent <GlassEarTagalong>().frozen = true;

                    eventData.Use();
                    return;
                }
            }

            GameObject newO = Instantiate(captions[0]);

            newO.GetComponent <GlassEarTagalong>().frozen = false;
            newO.transform.SetParent(transform);
            captions.Add(newO);

            eventData.Use();
            return;
        }