コード例 #1
0
 //将文字数据应用到UI上
 public void SetText(TextPiece currentPiece, string name, string dialog, string voice, string avatar = "")
 {
     this.currentPiece = currentPiece;
     nameLabel.text    = AddColor(name);
     dialogLabel.text  = ChangeName(dialog);
     //TODO : 头像
     te.ResetToBeginning();
     typewriting = true;
     //添加文字记录
     AddToTable(new BacklogText(name, dialog, voice));
 }
コード例 #2
0
 /// <summary>
 /// 将文字数据应用到UI上
 /// </summary>
 /// <param name="currentPiece"></param>
 /// <param name="name">角色姓名</param>
 /// <param name="dialog">对话</param>
 /// <param name="voice">语音文件</param>
 /// <param name="avatar">头像文件</param>
 public void SetText(TextPiece currentPiece, string dialog, string name, string avatar)
 {
     // 设置成禁用右键和滚轮?
     DataManager.GetInstance().BlockRightClick();
     DataManager.GetInstance().BlockWheel();
     this.currentPiece = currentPiece;
     SetNameText(name);
     // 替换主角姓名文本
     dialog = ChangeName(dialog);
     //dialogLabel.text = ;
     SetContentStyle();
     // 打字机
     te.enabled = true;
     te.ResetToBeginning(dialog);
     typewriting = true;
     // 头像
     SetAvatar(avatar);
 }
コード例 #3
0
    //将文字数据应用到UI上
    public void SetText(TextPiece currentPiece, string name, string dialog, string voice, string avatar = "")
    {
        //设置成禁用右键和滚轮?
        DataManager.GetInstance().BlockRightClick();
        DataManager.GetInstance().BlockWheel();
        this.currentPiece = currentPiece;
        //在原有基础上添加新文字?
        dialogLabel.text  = "[FFFFFF]" + dialogLabel.text + "[-]";
        dialogLabel.text += ChangeName(dialog);
        //去掉颜色标签符号
        Regex rx = new Regex(@"\[[^\]]+\]");

        DataManager.GetInstance().tempData.currentText = rx.Replace(dialogLabel.text, "");
        //打字机
        te.enabled = true;
        te.ResetToBeginning();
        typewriting = true;
        //添加文字记录
        AddToTable(new BacklogText(name, dialog, voice));
    }
コード例 #4
0
 //将文字数据应用到UI上
 public void SetText(TextPiece currentPiece, string name, string dialog, string voice, string avatar = "")
 {
     //设置成禁用右键和滚轮?
     DataManager.GetInstance().BlockRightClick();
     DataManager.GetInstance().BlockWheel();
     this.currentPiece = currentPiece;
     nameLabel.text    = AddColor(name);
     //替换已读文本
     dialogLabel.text  = ChangeName(dialog);
     dialogLabel.alpha = DataManager.GetInstance().IsTextRead(currentPiece) ? 0.5f : 1f;
     //去掉颜色标签符号
     DataManager.GetInstance().tempData.currentText = rx.Replace(dialogLabel.text, "");
     //头像
     SetAvatar(avatar);
     //打字机
     te.enabled = true;
     te.ResetToBeginning();
     typewriting = true;
     //添加文字记录
     AddToTable(new BacklogText(name, dialog, voice));
 }