Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using AC;
- using UnityEngine.EventSystems;
- namespace Scuac.Components
- {
- public class SkipSpeechButton : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
- {
- bool isPressed;
- bool isSpeechPlaying;
- public void OnPointerDown(PointerEventData eventData)
- {
- isSpeechPlaying = KickStarter.dialog.IsAnySpeechPlaying();
- isPressed = true;
- }
- public void OnPointerUp(PointerEventData eventData)
- {
- isPressed = false;
- }
- void Update()
- {
- if (!isPressed)
- return;
- if (isSpeechPlaying)
- {
- // These doesn't work here
- KickStarter.playerInput.ResetClick();
- KickStarter.playerInput.ResetMouseClick();
- // This works but cuts off the speech too late
- KickStarter.playerInput.SimulateInputButton("SkipSpeech");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement