コード例 #1
0
    void OnClickVoice()
    {
        DialogPartData data = ViNoBackLog.GetItemAt(m_LogIndex);

        if (data.isVoice && ISoundPlayer.Instance != null)
        {
            ISoundPlayer.Instance.PlayVoice(data.voiceAudioID, ViNoConfig.prefsVoiceVolume, 0f);
        }
    }
コード例 #2
0
    /// <summary>
    /// SendMessage to the TextTarget.
    /// </summary>
    /// <param name='index'>
    /// Index.
    /// </param>
    void OnChangedLogIndex(int index)
    {
//		string logStr = ViNoBackLog.GetLogText( index );
        DialogPartData data = ViNoBackLog.GetItemAt(index);

        if (voiceButton != null)
        {
            voiceButton.SetActive(data.isVoice);
        }
        if (nameTextTarget != null)
        {
            if (!string.IsNullOrEmpty(data.nameText) && data.nameText.Trim() != string.Empty)
            {
                nameTextTarget.gameObject.SetActive(true);
                nameTextTarget.gameObject.SendMessage("OnUpdateText", data.nameText);
            }
            else
            {
                nameTextTarget.gameObject.SetActive(false);
            }
        }
        textTarget.gameObject.SendMessage("OnUpdateText", data.dialogText);
    }