From 38d4a551880f913a873c3d2c91a98f0434dfa4b2 Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 6 Mar 2020 00:30:31 +0800 Subject: +init --- Assets/Scripts/Test.cs | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Assets/Scripts/Test.cs (limited to 'Assets/Scripts/Test.cs') 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 += ""; + Content += content + "\n"; + if(alert) + Content += ""; + 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); + } + +} -- cgit v1.1-26-g67d0