ย ย public IEnumerator SkipSequanceCoroutine(IEnumerator _seq, int index) {
ย ย ย ย yield return new WaitForSecondsRealtime(0.3f);
ย ย ย ย // yield return new WaitUntil(() => Input.GetKey(KeyCode.Z));ย
ย ย ย ย //Debug.Log($"SkipeSequence Key Check : { sequenceAction.SequenceUI.Interaction.triggered}");
ย ย ย ย yield return new WaitUntil(() => sequenceAction.SequenceUI.Interaction.triggered);ย ย ย <-------------์ฌ๊ธฐ
ย ย ย ย // yield return new WaitUntil(() => );
ย ย ย ย StopCoroutine(_seq);
ย ย ย ย textContext.text = t_context;
ย ย ย ย IEnumerator nextDialog = nextContext(index);
ย ย ย ย StartCoroutine(nextDialog);
ย ย }
๊ธฐ์กด์ ์๋์ ๊ฐ์ด ์์ฑํด์ ์ฌ์ฉ ํ๋๋ฐ
sequenceAction = new InputSystem() ์ ์ธํด๋๊ณ
yield return new WaitUntil(() => sequenceAction.SequenceUI.Interaction.triggered);
์ด๋ฒ์ ๊ฐ์์์ผ๋ฉด์
Controller sequenceAction;ย ย (Controller๋ InputSystem์ ์ธํฐํ์ด์ค๋ก ์์ฑํ ๊ฒ)ย ์ ์ธํด๋๊ณ
sequenceAction.SequenceEvent += HandleSequence;
public void HandleSequence() ์ด๋ฒคํธ ํธ๋ค๋ฌ๋ฅผ ํ๋๋ฌ์
yield return enw WaitUntill() ์๋ค๊ฐ ๋์ผํ triggered๋ฅผ ๋ฃ๊ณ ์ถ์ต๋๋ค..
SequnceEvent์ ๋์ํ๋ OnInteraction(InputAction.CallbackContext context) ํจ์๋
ย ย public void OnInteraction(InputAction.CallbackContext context)
ย ย {
ย ย ย ย if (context.phase == InputActionPhase.Started) {
ย ย ย ย ย ย InteractStartEvent?.Invoke();
ย ย ย ย }
ย ย ย ย if (context.phase == InputActionPhase.Performed)
ย ย ย ย {
ย ย ย ย ย ย InteractEvent?.Invoke(true);
ย ย ย ย }
ย ย ย ย if (context.phase == InputActionPhase.Canceled)
ย ย ย ย {
ย ย ย ย ย ย InteractEvent?.Invoke(false);
ย ย ย ย }
ย ย }
์์ ์ฒ๋ผ ๊ตฌ์ฑ ํด๋์๋๋ฐ..
๋จธ๋ฆฌ๋ฅผ ์ธ๋งค๊ณ ๊ณ ๋ฏผํด๋ด๋ ์ Triggered๋ฅผ WaitUntill์๋ค๊ฐ ๋ฃ์ ๋ฐฉ๋ฒ์ด ์๊ฐ์ด ์๋๋ค์..
์์ ๋ฐฉ๋ฒ์ ํ๋ฉด ํ๋ ์ด์ด - ์ํ์ค๊ฐ ON/OFF๊ฐ ์ ๋๋ก ์๋์ ๋ต๋ตํฉ๋๋ค..
ย
์ง๋ฌธ์ ์ฌ๋ฆฌ๋ ์๊ฐ์ ํด๊ฒฐ๋ฒ์ด ๋ ์ฌ๋ผ์ ํด๊ฒฐํด๋ฒ๋ ธ์ต๋๋ค..! ๊ณ ๋ง์์ ๋ฌ๋ฒ๋๊ฐค๋ผ๋ค