private void Awake() { if (instance != null) { Debug.LogWarning("WARNING: keep only one ink dialogue manager per scene!"); } instance = this; dialogueVaribles = new DialogueVariables(globalInkFile.filePath); }
private string getVariable(string variableName) { return((InkDialogueManager .GetInstance() .GetVariableState(variableName)).ToString()); }
private void Update() { // freeze player when playing dialogue if (InkDialogueManager.GetInstance().dialogueIsPlaying) { actionFreeze = true; animator.SetBool("isWalking", false); } else { actionFreeze = false; } if (!actionFreeze) { horizontalInput = Input.GetAxisRaw("Horizontal"); if (animator != null) { if (Mathf.Abs(horizontalInput) > 0.01f) { animator.SetBool("isWalking", true); } else { animator.SetBool("isWalking", false); } } if (horizontalInput < 0 && !sprite.flipX) { sprite.flipX = true; } if (horizontalInput > 0 && sprite.flipX) { sprite.flipX = false; } if (Input.GetKeyDown(KeyCode.I)) { showInventory = !showInventory; uiInventory.gameObject.SetActive(showInventory); } if (enterInteractable && !InkDialogueManager.GetInstance().dialogueIsPlaying) { if (Input.GetKeyDown(KeyCode.E)) { if (interactItem) { interactItem.TriggerDialogue(); if (interactItem.destroyOnInteract) { interactItem.DestroySelf(); } //interactItem.SetInteractable(false);// disable object after interation interactItem = null; enterInteractable = false; } uiManager.HideInteractPrompt(); } } } }
// Start is called before the first frame update void Start() { // load the dialogue for this drawing scene InkDialogueManager.GetInstance().EnterDialogueMode(inkJSON); }
public void StartDialogue() { InkDialogueManager.GetInstance().EnterDialogueMode(inkJSON); }