// 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); } }
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; }
// 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); } } }
// Start is called before the first frame update void Start() { inputManager = InputManager.Instance(); inputPad = inputManager.CreateInputPad(); CustomEventSystem.Instance().Enter(buttons[0].gameObject); }