Exemplo n.º 1
0
 private void OnDisable()
 {
     if (_lastIsMouseInRect)
     {
         BBInput.ActivatePreviousProfile();
     }
 }
Exemplo n.º 2
0
 private void Update()
 {
     if (Input.GetMouseButtonDown(0))
     {
         bool isMouseInRect = false;
         if (_canvas.renderMode == RenderMode.ScreenSpaceCamera)
         {
             isMouseInRect = RectTransformUtility.RectangleContainsScreenPoint(
                 _rectTransform, Input.mousePosition, _canvas.worldCamera
                 );
         }
         else
         {
             isMouseInRect = RectTransformUtility.RectangleContainsScreenPoint(
                 _rectTransform, Input.mousePosition
                 );
         }
         if (isMouseInRect && !_lastIsMouseInRect)
         {
             BBInput.SetActiveProfile("Console");
         }
         else if (_lastIsMouseInRect)
         {
             BBInput.ActivatePreviousProfile();
         }
         _lastIsMouseInRect = isMouseInRect;
     }
 }
Exemplo n.º 3
0
    private void Awake()
    {
        SetDialogue("story");

        BBInput.SetActiveProfile("Dialogue");
        BBInput.AddOnAxisPressed("ContinueDialogue", NextSentence);
        BBInput.AddOnAxisPressed("DialogueOptionMoveUp", MoveDialogueOptionUp);
        BBInput.AddOnAxisPressed("DialogueOptionMoveDown", MoveDialogueOptionDown);

        StartCoroutine(DisplayDialogue());
    }
Exemplo n.º 4
0
        private void Awake()
        {
            _field         = GetComponent <InputField>();
            _text          = _field.textComponent;
            _rectTransform = GetComponent <RectTransform>();
            _canvas        = FindObjectsOfType <Canvas>().Where(
                canvas => canvas.GetComponentsInChildren <DebugConsoleInputField>().Contains(this)
                ).First();

            BBInput.AddOnAxisPressed("EnterCommand", () => { if (this != null)
                                                             {
                                                                 OnCommandEntered(_field.text);
                                                             }
                                     });
        }