1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
| #if UNITY_EDITOR
| using System.Collections;
| using System.Collections.Generic;
| using UnityEngine;
| using System;
| using System.IO;
| using UnityEditor;
|
| public class RunTimeABLoadLog
| {
| static List<string> assetBundleLoadLogs = new List<string>();
|
| public static void AddLog(string _abName, string _asset, string _scene)
| {
| var log = StringUtility.Contact(_scene, "\t", _abName, "\t", _asset, "\t", DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));
| assetBundleLoadLogs.Add(log);
| }
|
| [MenuItem("程序/打印资源包加载日志")]
| public static void Print()
| {
| var tile = StringUtility.Contact("场景名", "\t", "资源包名", "\t", "资源名", "\t", "时间");
| assetBundleLoadLogs.Insert(0, tile);
| File.WriteAllLines(Application.dataPath + "/RunTimeABLoadLog.txt", assetBundleLoadLogs.ToArray());
| }
|
| }
| #endif
|
|