public IEnumerator Switching() { MessageWindow messageWindow = MessageSystem.GetWindow(); PlayerInteract.InteractableStart(); //スイッチがオンのときオフに切り替える //Switch off when switch is on if (isOnSwitch) { isOnSwitch = false; spriteRenderer.sprite = offImage; OffSwitch.Invoke(); yield return(new WaitForSeconds(wait)); yield return(StartCoroutine(messageWindow.ShowClick(offMessage))); } else { isOnSwitch = true; spriteRenderer.sprite = onImage; OnSwitch.Invoke(); yield return(new WaitForSeconds(wait)); yield return(StartCoroutine(messageWindow.ShowClick(onMessage))); } messageWindow.Close(); PlayerInteract.InteractableEnd(); yield break; }
public IEnumerator OpenBox() { MessageWindow messageWindow = MessageSystem.GetWindow(); PlayerInteract.InteractableStart(); if (isOpen) { yield return(StartCoroutine(messageWindow.ShowClick("からっぽだ"))); messageWindow.Close(); PlayerInteract.InteractableEnd(); yield break; } //お金が入っていた if (money > 0) { yield return(GetMony()); } //アイテムが入っていた if (item != null) { yield return(GetItem()); } //装備が入っていた if (equipment != null) { yield return(GetEqip()); } //フラグの保存 VariablePersister.SetBool(key, true); PlayerInteract.InteractableEnd(); yield break; }
public IEnumerator Talk() { MessageWindow messageWindow = MessageSystem.GetWindow(); PlayerInteract.InteractableStart(); //会話文章の表示 //display talk List <string> content = conversation; foreach (var item in content) { yield return(new WaitForEndOfFrame()); yield return(StartCoroutine(messageWindow.ShowClick(item))); yield return(new WaitForEndOfFrame()); } messageWindow.Close(); PlayerInteract.InteractableEnd(); }
public void Open() { PlayerInteract.InteractableStart(); }
private void OnEnable() { //PlayerMovement.canMove = false; PlayerInteract.InteractableStart(); }