前因:文本中的换行 \n没有换行而是打印出来了,解决方式
因为unity会默认把\n替换成\\n
面板中使用富文本这个选项啊 没有用
m_text.text = m_text.text.Replace("\\n", "\n");
###动态中英文互译
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using UnityEngine.Video;
using System;
using static EasyLanguage;
public class UIManage : MonoBehaviour//, IPointerDownHandler, IPointerUpHandler
{
public VideoPlayer[] videoPlay;
//实例
private EasyLanguage m_language;
//中英按钮
public Button chinese_btn;
public Button sound_btn;
private AudioSource audios;
private bool sound;
private bool chinese=true;//中文
private void Awake()
{
m_language = EasyLanguage.GetInstance();
}
void Start() {
audios = GetComponent<AudioSource>();
chinese_btn.onClick.AddListener(ChineseChanged);
ChineseChanged();
}
/// <summary>
/// 中英互译
/// </summary>
private void ChineseChanged()
{
if (chine