Browse Source

添加标题配置,配置方法为修改_data/StreamingAssetsPath/Title.json 里的中文汉字

develop
曹衍涛 4 years ago
parent
commit
84788af450
  1. BIN
      Assets/Scene/StartScene.unity
  2. 32
      Assets/Scripts/LoadTitle.cs
  3. 11
      Assets/Scripts/LoadTitle.cs.meta
  4. 1
      Assets/StreamingAssets/Title.json
  5. 7
      Assets/StreamingAssets/Title.json.meta

BIN
Assets/Scene/StartScene.unity

Binary file not shown.

32
Assets/Scripts/LoadTitle.cs

@ -0,0 +1,32 @@
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
using UnityEngine.UI;
public class LoadTitle : MonoBehaviour
{
public Text text;
// Start is called before the first frame update
void Start()
{
LoadTitlefunc();
}
// Update is called once per frame
void Update()
{
}
void LoadTitlefunc()
{
string json = null;
string path = Path.Combine(Application.streamingAssetsPath, "Title.json");
if (File.Exists(path))
{
json = File.ReadAllText(path);
}
text.text = JsonConvert.DeserializeObject<string>(json);
}
}

11
Assets/Scripts/LoadTitle.cs.meta

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d64e4ca3b4bbfe646bf7890bd597e47b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

1
Assets/StreamingAssets/Title.json

@ -0,0 +1 @@
"-----> 电子沙盘 <-----"

7
Assets/StreamingAssets/Title.json.meta

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a3c640d0a8aef9342a2c5f94762ca727
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Loading…
Cancel
Save