コード例 #1
0
ファイル: SoundNode.cs プロジェクト: sjb8100/src
 public override void Stop()
 {
     Engine.IAudio audio = Engine.RareEngine.Instance().GetAudio();
     if (audio != null)
     {
         audio.StopEffect(m_audioID);
     }
 }
コード例 #2
0
ファイル: SoundNode.cs プロジェクト: sjb8100/src
 public override void Dead()
 {
     if (TimerAxis.Instance().IsExist(m_uAuidoStopTimerID, this))
     {
         TimerAxis.Instance().KillTimer(m_uAuidoStopTimerID, this);
     }
     Engine.IAudio audio = Engine.RareEngine.Instance().GetAudio();
     if (audio != null)
     {
         audio.StopEffect(m_audioID);
     }
     bLoop = false;
     FreeToNodePool();
 }
コード例 #3
0
    /// <summary>
    /// 执行跳过
    /// </summary>
    private void DoJump()
    {
        if (m_dialogInfo != null)
        {
            if (m_dialogInfo.talkVoice != null && m_dialogInfo.lstTalks.Count == m_dialogInfo.talkVoice.Length)
            {
                if (m_nindex == m_dialogInfo.talkVoice.Length - 1)
                {
                    JumpEnd();
                    return;
                }
                Engine.IAudio audio = Engine.RareEngine.Instance().GetAudio();
                if (audio != null && m_nPlayingAudioId != 0)
                {
                    audio.StopEffect(m_nPlayingAudioId);
                }
                table.ResourceDataBase resDB = GameTableManager.Instance.GetTableItem <table.ResourceDataBase>(m_dialogInfo.talkVoice[m_dialogInfo.lstTalks.Count - 1]);
                if (resDB == null)
                {
                    Engine.Utility.Log.Error("找不到选择角色的Mp3资源");
                }

                if (audio != null && resDB != null)
                {
                    //m_nPlayingAudioId = audio.PlayUIEffect(resDB.strPath);
                    Client.IPlayer mainPlayer = Client.ClientGlobal.Instance().MainPlayer;
                    Transform      tf         = mainPlayer.GetTransForm();
                    if (tf != null)
                    {
                        m_nPlayingAudioId = audio.PlayEffect(tf.gameObject, resDB.strPath, false, true);
                    }
                }
            }
        }

        JumpEnd();
    }
コード例 #4
0
    bool ShowTalkStr(int nindex)
    {
        bool success = false;

        if (m_dialogInfo != null)
        {
            if (m_dialogInfo.buttons != null)
            {
                if (m_dialogInfo.buttons.Count < 2)
                {
                    StopAllCoroutines();
                    //倒计时
                    tempTime  = 0;
                    CLOSETIME = CONST_TASK_CD;
                    m_label_LabelNext.gameObject.SetActive(true);
                    m_label_LabelNext.text = ((int)CLOSETIME).ToString() + "秒后自动跳过";
                    StartCoroutine(WaitToClose());
                }
                else
                {
                    m_label_LabelNext.gameObject.SetActive(false);
                }
            }
        }


        ResetDes();
        if (m_dialogInfo != null)
        {
            if (m_dialogInfo.lstTalks != null)
            {
                if (nindex < m_dialogInfo.lstTalks.Count)
                {
                    LangTalkData.Talk talkInfo = m_dialogInfo.lstTalks[nindex];

                    if (talkInfo.bUser)
                    {
                        string name = "";
                        if (Client.ClientGlobal.Instance().MainPlayer != null)
                        {
                            name = Client.ClientGlobal.Instance().MainPlayer.GetName();
                        }
                        m_label_nameLabel.text = name;
                        ShowRoleTexture(true);
                    }
                    else
                    {
                        table.NpcDataBase npcdata = GameTableManager.Instance.GetTableItem <table.NpcDataBase>(m_dialogInfo.nNpcId);
                        if (npcdata != null)
                        {
                            ShowRoleTexture(false, npcdata);

                            m_label_nameLabel.text = npcdata.strName;
                        }
                    }

                    bool useRichText = false;//富文本有泄漏bug 暂时不用
                    if (useRichText)
                    {
                        string desc = string.Format("<size value=\"24\"><color value=\"#1c2850\">{0} </color></size>", talkInfo.strText);
                        if (uiXmlRichText != null)
                        {
                            this.uiXmlRichText.fontSize = 24;
                            this.uiXmlRichText.AddXml(RichXmlHelper.RichXmlAdapt(desc));
                        }
                    }
                    else
                    {
                        string desc = string.Format("[1c2850]{0}[-]", talkInfo.strText);
                        m_label_normalText.text = desc;
                    }

                    success = true;
                }
            }

            if (m_dialogInfo.talkVoice != null && nindex < m_dialogInfo.talkVoice.Length)
            {
                Engine.IAudio audio = Engine.RareEngine.Instance().GetAudio();
                if (audio != null && m_nPlayingAudioId != 0)
                {
                    audio.StopEffect(m_nPlayingAudioId);
                }
                table.ResourceDataBase resDB = GameTableManager.Instance.GetTableItem <table.ResourceDataBase>(m_dialogInfo.talkVoice[nindex]);
                if (resDB == null)
                {
                    Engine.Utility.Log.Error("找不到选择角色的Mp3资源");
                }

                if (audio != null && resDB != null)
                {
                    //m_nPlayingAudioId = audio.PlayUIEffect(resDB.strPath);
                    Client.IPlayer mainPlayer = Client.ClientGlobal.Instance().MainPlayer;
                    if (mainPlayer != null)
                    {
                        Transform tf = mainPlayer.GetTransForm();
                        if (tf != null)
                        {
                            m_nPlayingAudioId = audio.PlayEffect(tf.gameObject, resDB.strPath, false, true);
                        }
                    }
                }
            }
        }

        //是否显示下一个
        //bool nextVisible = (null != m_dialogInfo
        //    && null != m_dialogInfo.lstTalks
        //    && (m_dialogInfo.lstTalks.Count > nindex + 1));
        //if (null != m_label_LabelNext && m_label_LabelNext.gameObject.activeSelf != nextVisible)
        //{
        //    m_label_LabelNext.gameObject.SetActive(nextVisible);
        //}

        return(success);
    }