Exemple #1
0
    // Update is called once per frame
    void Update()
    {
        wait -= Time.deltaTime;
        if (wait > 0.0f)
        {
            return;
        }

        if (inputPad.IsTrigger(InputType.Button.KeyLeft) || inputPad.IsTrigger(InputType.Button.KeyRight))
        {
            index++;
            if (index > buttons.Length - 1)
            {
                index = 0;
            }
            CustomEventSystem.Instance().Enter(buttons[index].gameObject);
        }
        else if (inputPad.IsTrigger(InputType.Button.Right))
        {
            CustomEventSystem.Instance().Click();
        }
        else if (inputPad.IsTrigger(InputType.Button.Down))
        {
            buttons[0].OnClick?.Invoke();
            Destroy(gameObject);
        }
    }
Exemple #2
0
    public void OnPointerEnter(PointerEventData eventData)
    {
        //現在選択しているものを選択解除呼び出し
        var cgo = CustomEventSystem.Instance().CurrentSelected;

        if (cgo != null)
        {
            var handler = cgo.GetComponent <ButtonBase>();
            if (handler != null)
            {
                handler.Exit();
            }
        }

        //選択呼び出し
        Enter();
        //選択オブジェクトを上書き
        CustomEventSystem.Instance().CurrentSelected = gameObject;
    }
Exemple #3
0
    // Update is called once per frame
    void Update()
    {
        wait -= Time.deltaTime;
        if (wait > 0.0f)
        {
            return;
        }

        {
            if (inputPad.IsTrigger(InputType.Button.Right))
            {
                CustomEventSystem.Instance().Click();
                button.OnClick?.Invoke();
                Destroy(gameObject);
            }
            else if (inputPad.IsTrigger(InputType.Button.Down))
            {
                button.OnClick?.Invoke();
                Destroy(gameObject);
            }
        }
    }
Exemple #4
0
 // Start is called before the first frame update
 void Start()
 {
     inputManager = InputManager.Instance();
     inputPad     = inputManager.CreateInputPad();
     CustomEventSystem.Instance().Enter(buttons[0].gameObject);
 }