コード例 #1
0
    public void Begin(string dialog, Character character, bool isCharAlive, AudioClip audioClip)
    {
        characterImage.sprite = character.DialogSprite;
        if (character.Name == "")
        {
            nameBack.SetActive(false);
        }
        else
        {
            nameBack.SetActive(true);
        }
        CurentDialogBegin?.Invoke();
        characterImage.color = isCharAlive ? Color.white : Color.black;
        characterName.text   = character.Name;
        pushDialogNext.gameObject.SetActive(true);
        stopClicking.gameObject.SetActive(true);
        VD.OnNodeChange += UpdateUI;
        VD.OnEnd        += End;
        VD.BeginDialogue(dialog);

        if (audioClip != null && isCharAlive)
        {
            audioSource.clip = audioClip;
            audioSource.Play();
        }
    }
コード例 #2
0
 void BeginDialogue()
 {
     VD.OnNodeChange += OnNodeChange;
     VD.OnEnd        += OnEnd;
     VD.BeginDialogue(GetComponent <VIDE_Assign>());
     dialogue_Background.SetActive(true);
 }
コード例 #3
0
 private void Begin()
 {
     VD.OnNodeChange += UpdateUI;
     VD.OnEnd        += End;
     VD.BeginDialogue(GetComponent <VIDE_Assign>());
     Debug.Log("ttt");
 }
コード例 #4
0
    //This begins the conversation
    void Begin(VIDE_Assign dialogue)
    {
        //Let's reset the NPC text variables
        NPC_Text.text    = "";
        NPC_label.text   = "";
        playerLabel.text = "";

        NPCPhotoFrame.transform.localEulerAngles    = new Vector3(0, 0, Random.Range(rotationMin, rotationMax));
        playerPhotoFrame.transform.localEulerAngles = new Vector3(0, 0, Random.Range(rotationMin, rotationMax));

        //First step is to call BeginDialogue, passing the required VIDE_Assign component
        //This will store the first Node data in VD.nodeData
        //But before we do so, let's subscribe to certain events that will allow us to easily
        //Handle the node-changes
        VD.OnActionNode += ActionHandler;
        VD.OnNodeChange += UpdateUI;
        VD.OnEnd        += EndDialogue;

        VD.BeginDialogue(dialogue); //Begins dialogue, will call the first OnNodeChange

        dialogueContainer.transform.DOKill();
        dialogueContainer.transform.localPosition = new Vector3(0, 300);
        dialogueContainer.transform.DOLocalMoveY(0, .5f).SetEase(Ease.OutExpo);

        dialogueContainer.SetActive(true); //Let's make our dialogue container visible
        CameraFollow.instance.target = dialogue.gameObject.transform;
        CameraFollow.instance.ChangeDefaultDistance(false, CameraFollow.instance.zoomDefaultDistance);
    }
コード例 #5
0
    //Will start and end the assigned dialogue
    public void Interact()
    {
        if (!questChartContainer.activeSelf)
        {
            questChartContainer.SetActive(true);
            VD.NodeData nd = VD.BeginDialogue(assigned);
            LoadChart(nd);
        }
        else
        {
            for (int i = 0; i < peGameObject.transform.parent.childCount; i++)
            {
                if (i != 0)
                {
                    Destroy(peGameObject.transform.parent.GetChild(i).gameObject);
                }
            }

            for (int i = 0; i < ovGameObject.transform.parent.childCount; i++)
            {
                if (i != 0)
                {
                    Destroy(ovGameObject.transform.parent.GetChild(i).gameObject);
                }
            }

            questChartContainer.SetActive(false);
            VD.EndDialogue();
        }
    }
コード例 #6
0
 public void Begin(VIDE_Assign videAssign)
 {
     VD.OnNodeChange += UpdateUI;
     VD.OnEnd        += End;
     // This loads the VIDE_Assign into the VD.
     //If you want to play other dialogs, you would have to select a different VIDE_Assign here.
     VD.BeginDialogue(videAssign);
 }
コード例 #7
0
 protected void Begin()
 {
     PlayerMovements.isPlayerInputEnable = false;
     VD.OnNodeChange += UpdateUI;
     VD.OnEnd        += End;
     VD.BeginDialogue(GetComponent <VIDE_Assign>());
     VD.SetNode(HorseState.GET_STATE());
 }
コード例 #8
0
ファイル: UIManager.cs プロジェクト: bad-red-project/farm-rat
 private void StartDialog(VIDE_Assign videAssign)
 {
     HideJoystick();
     HideDialogAction();
     ShowReplicaContainer();
     VD.OnNodeChange += UpdateDialogUI;
     VD.OnEnd        += EndDialog;
     VD.BeginDialogue(videAssign);
 }
コード例 #9
0
    void Begin()
    {
        VD.OnNodeChange += UpdateUI;
        VD.OnEnd        += End;
        VD.BeginDialogue(GetComponent <VIDE_Assign>());

        //Wappenteil Pferd freischalten
        StartCoroutine(rest.TransmitUnlockCoaSymbol());
    }
コード例 #10
0
    public void StartEvent(string dialogueName)
    {
        eventPanel.SetActive(true);

        VD.OnNodeChange += UpdateUI;
        VD.OnEnd        += EndDialogue;
        VD.BeginDialogue(dialogueName);

        Time.timeScale = 0;
    }
コード例 #11
0
ファイル: Dialogue_UIManager.cs プロジェクト: Bund187/Majorel
 //Este metodo es el primero que se llama al empezar el dialogo
 public void Begin(VIDE_Assign vide_Assign, GameObject npc, GameObject npcTxt)
 {
     Container_NPC = npc;
     Container_NPC.SetActive(false);
     textNpc          = npcTxt.GetComponent <Text>();
     npcSayLine       = npcTxt.GetComponent <SayLineText>();
     VD.OnNodeChange += UpdateUI;
     VD.OnEnd        += End;
     VD.BeginDialogue(vide_Assign);
 }
コード例 #12
0
    public void StartDialogue(string dialogue)
    {
        dialogueMenu.gameObject.SetActive(true);

        vIDE.AssignNew(dialogue);

        VD.OnNodeChange += UpdateNode;
        VD.OnEnd        += EndDialog;
        VD.BeginDialogue(vIDE);
    }
コード例 #13
0
    public void LoadDialogue(string dialogueName, int overrideStartNode)
    {
        Setup();
        VIDE_Assign assign = new VIDE_Assign();

        assign.overrideStartNode = overrideStartNode;
        assign.AssignNew(dialogueName);

        VD.BeginDialogue(assign);
    }
コード例 #14
0
 //Called by UI button
 public void Begin()
 {
     if (!VD.isActive)
     {
         transform.GetChild(1).gameObject.SetActive(true);  //UI stuff
         transform.GetChild(0).gameObject.SetActive(false); //UI stuff
         VD.OnNodeChange += NodeChangeAction;               //Required events
         VD.OnEnd        += End;                            //Required events
         VD.BeginDialogue(dialogueNameToLoad);
     }
 }
コード例 #15
0
        //This begins the conversation.
        private void Begin(VIDE_Assign dialogue)
        {
            //Subscribe to events
            VD.OnActionNode += ActionHandler;
            //VD.OnNodeChange += diagUI.UpdateUI;
            VD.OnEnd += EndDialogue;
            VD.BeginDialogue(dialogue); //Begins dialogue, will call the first OnNodeChange

            OnDialogueStart.Invoke();
            dialogActive = true;
        }
コード例 #16
0
 private void Begin(VIDE_Assign dialogue)
 {
     VD.OnNodeChange += UpdateUI;
     VD.OnEnd        += End;
     VD.BeginDialogue(dialogue);
     Debug.Log(GameManager.Instance.PlayerState.State);
     if (GameManager.Instance.PlayerState.SetPlayerState(PlayerState.States.InDialogue))
     {
         Debug.Log("Set state");
     }
 }
コード例 #17
0
    public void StartEvent()
    {
        eventPanel.SetActive(true);

        VD.OnNodeChange += UpdateUI;
        VD.OnEnd        += EndDialogue;
        int randomDialog = GetRandomDialog();

        VD.BeginDialogue(dialogues[randomDialog]);

        Time.timeScale = 0;
    }
コード例 #18
0
 public void StartDialogue(VIDE_Assign dialogue)
 {
     if (dialogue != null)
     {
         VD.OnNodeChange += UpdateUI;
         VD.OnEnd        += End;
         VD.BeginDialogue(dialogue);
     }
     else
     {
         Debug.Log("UIManager, StartDialogueWith: tried to start a dialogue without proper dialogue specified");
     }
 }
コード例 #19
0
    protected void OnBeginDialog()
    {
        VD.OnNodeChange += this.OnDialogChanged;

        try
        {
            VD.BeginDialogue(dialogAssignObj);
        }
        catch
        {
            Debug.Log("Error");
        }
    }
コード例 #20
0
ファイル: DEMO_UIManager.cs プロジェクト: LilLynya/TIMB
    void Start()
    {
        //Disable UI when starting just in case
        NPC_text.gameObject.SetActive(false);
        foreach (Text t in PLAYER_text)
        {
            t.transform.parent.gameObject.SetActive(false);
        }

        //Subscribe to some events and Begin the Dialogue
        VD.OnNodeChange += UpdateUI;
        VD.OnEnd        += End;
        VD.BeginDialogue(GetComponent <VIDE_Assign>()); //This is the first most important method when using VIDE
    }
コード例 #21
0
    private void Begin()
    {
        VD.OnActionNode += ActionUI;
        VD.OnNodeChange += UpdateUI;
        VD.OnEnd        += End;
        ResetPlayerChoiceTxt();
        containerDialogue.SetActive(true);
        cursorManager.showDialogBox = true;
        if (npcVideAssign != null)
        {
            VD.BeginDialogue(npcVideAssign);
        }

        VD.SetNode(checkPoint);
    }
コード例 #22
0
    //This begins the conversation.
    void Begin(VIDE_Assign dialogue)
    {
        //Let's reset the NPC text variables
        NPC_Text.text    = "";
        NPC_label.text   = "";
        playerLabel.text = "";

        //Subscribe to events
        VD.OnActionNode += ActionHandler;
        VD.OnNodeChange += UpdateUI;
        VD.OnEnd        += EndDialogue;

        VD.BeginDialogue(dialogue);        //Begins dialogue, will call the first OnNodeChange

        dialogueContainer.SetActive(true); //Let's make our dialogue container visible
    }
コード例 #23
0
        /// <summary>
        /// Called when the communication with a NPC begins.
        /// </summary>
        /// <param name="dialog">Dialogue lines for this NPC.</param>
        /// <param name="npcAvatar">Avatar of the NPC.</param>
        /// <param name="npcName">Name of the NPC.</param>
        public void OpenNPCCom(VIDE_Assign dialog, Sprite npcAvatar, string npcName)
        {
            if (!VD.isActive)
            {
                _npcComPanel.SetActive(true);

                ShipManager.Instance.StopShip();
                Cursor.visible = true;

                _npcAvatar.sprite = npcAvatar;
                _npcName.text     = npcName;

                VD.OnNodeChange += UpdateUI;
                VD.OnEnd        += End;
                VD.BeginDialogue(dialog);
            }
        }
コード例 #24
0
    //This begins the conversation (Called by examplePlayer script)
    public void Begin(VIDE_Assign diagToLoad, GameObject textArea, bool isPlayerUp)
    {
        //Let's clean the NPC text variables
        uiContainer = textArea;
        talkText    = uiContainer.transform.Find("Talk Text").GetComponent <Text>();

        talkText.text = "";

        VD.OnActionNode += ActionHandler;
        VD.OnNodeChange += NodeChangeAction;
        VD.OnEnd        += EndDialogue;

        VD.BeginDialogue(diagToLoad);
        if (isPlayerUp)
        {
            PlayerUp();
        }
    }
コード例 #25
0
    //This begins the conversation
    void Begin(VIDE_Assign dialogue)
    {
        //Let's reset the NPC text variables
        NPC_Text.text    = "";
        NPC_label.text   = "";
        playerLabel.text = "";

        //First step is to call BeginDialogue, passing the required VIDE_Assign component
        //This will store the first Node data in VD.nodeData
        //But before we do so, let's subscribe to certain events that will allow us to easily
        //Handle the node-changes
        VD.OnActionNode += ActionHandler;
        VD.OnNodeChange += UpdateUI;
        VD.OnEnd        += EndDialogue;

        VD.BeginDialogue(dialogue);        //Begins dialogue, will call the first OnNodeChange

        dialogueContainer.SetActive(true); //Let's make our dialogue container visible
    }
コード例 #26
0
    //This begins the conversation (Called by examplePlayer script)
    public void Begin(VIDE_Assign diagToLoad)
    {
        //Let's clean the NPC text variables
        npcText.text = "";
        npcName.text = "";

        //First step is to call BeginDialogue, passing the required VIDE_Assign component
        //This will store the first Node data in VD.nodeData
        //But before we do so, let's subscribe to certain events that will allow us to easily
        //Handle the node-changes
        VD.OnActionNode += ActionHandler;
        VD.OnNodeChange += NodeChangeAction;
        VD.OnEnd        += EndDialogue;

        SpecialStartNodeOverrides(diagToLoad); //This one checks for special cases when overrideStartNode could change right before starting a conversation

        VD.BeginDialogue(diagToLoad);          //Begins conversation, will call the first OnNodeChange
        uiContainer.SetActive(true);
    }
コード例 #27
0
    //  テキストの表示
    void OnGUI()
    {
        if (VD.isActive)
        {
            var data = VD.nodeData;
            if (data.isPlayer)
            {
                for (int i = 0; i < data.comments.Length; i++)
                {
                    //  ボタンが押されたら
                    if (GUILayout.Button(data.comments[i]))
                    {
                        //  次に移動
                        data.commentIndex = i;
                        VD.Next();
                    }
                }
            }
            else
            {
                GUILayout.Label(data.comments[data.commentIndex]);

                if (GUILayout.Button("PUSH"))
                {
                    VD.Next();
                }
            }
            if (data.isEnd)
            {
                //  VIDEの削除
                VD.EndDialogue();
            }
        }
        else
        {
            if (GUILayout.Button("ReturnStart"))
            {
                //  VIDE_Assign読込み
                VD.BeginDialogue(GetComponent <VIDE_Assign>());
            }
        }
    }
コード例 #28
0
    void OnGUI()
    {
        if (VD.isActive)
        {
            var data = VD.nodeData; //Quick reference
            if (data.isPlayer)      // If it's a player node, let's show all of the available options as buttons
            {
                for (int i = 0; i < data.comments.Length; i++)
                {
                    if (GUILayout.Button(data.comments[i])) //When pressed, set the selected option and call Next()
                    {
                        data.commentIndex = i;
                        VD.Next();
                    }
                }
            }
            else   //if it's a NPC node, Let's show the comment and add a button to continue
            {
                GUILayout.Label(data.comments[data.commentIndex]);

                if (GUILayout.Button(">"))
                {
                    VD.Next();
                }
            }
            if (data.isEnd)             // If it's the end, let's just call EndDialogue
            {
                VD.EndDialogue();
            }
        }
        else   // Add a button to begin conversation if it isn't started yet
        {
            if (GUILayout.Button("Start Convo"))
            {
                VD.BeginDialogue(GetComponent <VIDE_Assign>()); //We've attached a VIDE_Assign to this same gameobject, so we just call the component
            }
        }
    }
コード例 #29
0
 void Begin()
 {
     VD.OnNodeChange += UpdateUI;
     VD.OnEnd        += End;
     VD.BeginDialogue(GetComponent <VIDE_Assign>());
 }
コード例 #30
0
 public void Begin(VIDE_Assign dialogue)
 {
     VD.BeginDialogue(dialogue); //Begins dialogue, will call the first OnNodeChange
     //Debug.Log("Entered Begin");
 }