Пример #1
0
 private void Awake()
 {
     if (instance != null)
     {
         Debug.LogWarning("WARNING: keep only one ink dialogue manager per scene!");
     }
     instance         = this;
     dialogueVaribles = new DialogueVariables(globalInkFile.filePath);
 }
Пример #2
0
 private string getVariable(string variableName)
 {
     return((InkDialogueManager
             .GetInstance()
             .GetVariableState(variableName)).ToString());
 }
Пример #3
0
    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();
                }
            }
        }
    }
Пример #4
0
 // Start is called before the first frame update
 void Start()
 {
     // load the dialogue for this drawing scene
     InkDialogueManager.GetInstance().EnterDialogueMode(inkJSON);
 }
Пример #5
0
 public void StartDialogue()
 {
     InkDialogueManager.GetInstance().EnterDialogueMode(inkJSON);
 }