summaryrefslogtreecommitdiff
path: root/Assets/Scripts/Test.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2020-03-06 00:30:31 +0800
committerchai <chaifix@163.com>2020-03-06 00:30:31 +0800
commit38d4a551880f913a873c3d2c91a98f0434dfa4b2 (patch)
treea7fd10896449b6596ac464dd3d4881dbc6fd8c82 /Assets/Scripts/Test.cs
Diffstat (limited to 'Assets/Scripts/Test.cs')
-rw-r--r--Assets/Scripts/Test.cs56
1 files changed, 56 insertions, 0 deletions
diff --git a/Assets/Scripts/Test.cs b/Assets/Scripts/Test.cs
new file mode 100644
index 0000000..da32140
--- /dev/null
+++ b/Assets/Scripts/Test.cs
@@ -0,0 +1,56 @@
+using System.Collections;
+using System.Collections.Generic;
+using System.Security.Cryptography;
+using System.IO;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class Test : MonoBehaviour {
+
+ public Text text;
+ string Content;
+
+ public void Print(string content, bool alert = false)
+ {
+ if (content == null)
+ content = "空";
+ if(alert)
+ Content += "<Color=#ff0000ff>";
+ Content += content + "\n";
+ if(alert)
+ Content += "</Color>";
+ text.text = Content;
+ }
+
+ private void Awake()
+ {
+ ResManager.Instance.Init(this);
+ }
+
+ public void Testing()
+ {
+ Print("----------------------------------------------------------------------------------------");
+ Print("Application.dataPath=" + Application.dataPath);
+ Print("Application.streamingAssetsPath=" + Application.streamingAssetsPath);
+ Print("Application.persistentDataPath=" + Application.persistentDataPath);
+ Print("Application.temporaryCachePath=" + Application.temporaryCachePath);
+ Print("----------------------------------------------------------------------------------------");
+ Print("读取Assets/Resources/res1.txt , 内容是");
+ Print(ResManager.Instance.ResContent("res1"));
+ Print("读取Assets/Resources/SubFolder/res1.txt , 内容是");
+ Print(ResManager.Instance.ResContent("SubFolder/res1"));
+ Print("读取Assets/Art/Resources/res5.txt , 内容是");
+ Print(ResManager.Instance.ResContent("res5"));
+ Print("----------------------------------------------------------------------------------------");
+ // AssetBundle.LoadAsset()可以省略后缀
+ Print("读取Assets/Files/file1.txt , 内容是");
+ Print(ResManager.Instance.BundleContent("file1.txt"));
+ Print(ResManager.Instance.BundleContent("file1"));
+ Print("读取Assets/Files/file1.abc, 内容是");
+ Print(ResManager.Instance.BundleContent("file1.abc"));
+ Print("读取Assets/Files/file1.bcd, 内容是");
+ Print(ResManager.Instance.BundleContent("file1.bcd"));
+ Print("说明进Bundle的资源不含后缀的资源名字不能冲突", true);
+ }
+
+}