修改框架,增加渲染管线扩展包
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ffdce56728c4f0943b14d5dd2f1a4434
|
||||
guid: 0ecc08ef1d6ca1148a200120e465d381
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
@@ -0,0 +1,195 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Text;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace AssetClean {
|
||||
public class AssetCollector {
|
||||
public static readonly string exportXMLPath = "referencemap.xml";
|
||||
|
||||
public List<string> deleteFileList = new List<string>();
|
||||
List<CollectionData> referenceCollection = new List<CollectionData>();
|
||||
|
||||
public bool useCodeStrip = true;
|
||||
public bool saveEditorExtensions = true;
|
||||
|
||||
public void Collection(string[] collectionFolders) {
|
||||
try {
|
||||
|
||||
XmlSerializer serialize = new XmlSerializer(typeof(List<CollectionData>));
|
||||
|
||||
deleteFileList.Clear();
|
||||
referenceCollection.Clear();
|
||||
|
||||
if (File.Exists(exportXMLPath)) {
|
||||
using (StreamReader fileStream = new StreamReader(exportXMLPath)) {
|
||||
referenceCollection = (List<CollectionData>)serialize.Deserialize(fileStream);
|
||||
fileStream.Close();
|
||||
}
|
||||
}
|
||||
|
||||
List<IReferenceCollection> collectionList = new List<IReferenceCollection>();
|
||||
|
||||
if (useCodeStrip) {
|
||||
collectionList.Add(new ClassReferenceCollection(saveEditorExtensions));
|
||||
}
|
||||
|
||||
collectionList.AddRange(new IReferenceCollection[] {
|
||||
new ShaderReferenceCollection (),
|
||||
new AssetReferenceCollection (),
|
||||
});
|
||||
|
||||
foreach (IReferenceCollection collection in collectionList) {
|
||||
collection.Init(referenceCollection);
|
||||
collection.CollectionFiles();
|
||||
}
|
||||
|
||||
// Find assets
|
||||
var files = StripTargetPathsAll(useCodeStrip, collectionFolders);
|
||||
|
||||
foreach (var path in files) {
|
||||
var guid = AssetDatabase.AssetPathToGUID(path);
|
||||
deleteFileList.Add(guid);
|
||||
}
|
||||
EditorUtility.DisplayProgressBar("checking", "collection all files", 0.2f);
|
||||
UnregistReferenceFromResources();
|
||||
|
||||
EditorUtility.DisplayProgressBar("checking", "check reference from resources", 0.4f);
|
||||
UnregistReferenceFromScenes();
|
||||
|
||||
EditorUtility.DisplayProgressBar("checking", "check reference from scenes", 0.6f);
|
||||
if (saveEditorExtensions) {
|
||||
UnregistEditorCodes();
|
||||
}
|
||||
|
||||
EditorUtility.DisplayProgressBar("checking", "check reference from ignorelist", 0.8f);
|
||||
UnregistReferenceFromIgnoreList();
|
||||
UnregistReferenceFromExtensionMethod();
|
||||
|
||||
using (var fileStream = new StreamWriter(exportXMLPath)) {
|
||||
serialize.Serialize(fileStream, referenceCollection);
|
||||
fileStream.Close();
|
||||
}
|
||||
|
||||
} finally {
|
||||
EditorUtility.ClearProgressBar();
|
||||
}
|
||||
}
|
||||
|
||||
List<string> StripTargetPathsAll(bool isUseCodeStrip, string[] pathes) {
|
||||
var files = pathes.SelectMany(c => Directory.GetFiles(c, "*.*", SearchOption.AllDirectories))
|
||||
.Distinct()
|
||||
.Where(item => Path.GetExtension(item) != ".meta")
|
||||
.Where(item => Path.GetExtension(item) != ".js")
|
||||
.Where(item => Path.GetExtension(item) != ".dll")
|
||||
.Where(item => Regex.IsMatch(item, "[\\/\\\\]Gizmos[\\/\\\\]") == false)
|
||||
.Where(item => Regex.IsMatch(item, "[\\/\\\\]Plugins[\\/\\\\]Android[\\/\\\\]") == false)
|
||||
.Where(item => Regex.IsMatch(item, "[\\/\\\\]Plugins[\\/\\\\]iOS[\\/\\\\]") == false)
|
||||
.Where(item => Regex.IsMatch(item, "[\\/\\\\]Resources[\\/\\\\]") == false);
|
||||
|
||||
if (isUseCodeStrip == false) {
|
||||
files = files.Where(item => Path.GetExtension(item) != ".cs");
|
||||
}
|
||||
|
||||
return files.ToList();
|
||||
}
|
||||
|
||||
void UnregistReferenceFromIgnoreList() {
|
||||
var codePaths = deleteFileList.Where(fileName => Path.GetExtension(fileName) == ".cs");
|
||||
|
||||
foreach (var path in codePaths) {
|
||||
var code = ClassReferenceCollection.StripComment(File.ReadAllText(path));
|
||||
if (Regex.IsMatch(code, "static\\s*(partial)*\\s*class")) {
|
||||
UnregistFromDelteList(AssetDatabase.AssetPathToGUID(path));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UnregistReferenceFromExtensionMethod() {
|
||||
var resourcesFiles = deleteFileList
|
||||
.Where(item => Path.GetExtension(item) != ".meta")
|
||||
.ToArray();
|
||||
foreach (var path in AssetDatabase.GetDependencies(resourcesFiles)) {
|
||||
UnregistFromDelteList(AssetDatabase.AssetPathToGUID(path));
|
||||
}
|
||||
}
|
||||
|
||||
void UnregistReferenceFromResources() {
|
||||
var resourcesFiles = deleteFileList
|
||||
.Where(item => Regex.IsMatch(item, "[\\/\\\\]Resources[\\/\\\\]") == true)
|
||||
.Where(item => Path.GetExtension(item) != ".meta")
|
||||
.ToArray();
|
||||
foreach (var path in AssetDatabase.GetDependencies(resourcesFiles)) {
|
||||
|
||||
UnregistFromDelteList(AssetDatabase.AssetPathToGUID(path));
|
||||
}
|
||||
}
|
||||
|
||||
void UnregistReferenceFromScenes() {
|
||||
// Exclude objects that reference from scenes.
|
||||
var scenes = EditorBuildSettings.scenes
|
||||
.Where(item => item.enabled == true)
|
||||
.Select(item => item.path)
|
||||
.ToArray();
|
||||
foreach (var path in AssetDatabase.GetDependencies(scenes)) {
|
||||
|
||||
UnregistFromDelteList(AssetDatabase.AssetPathToGUID(path));
|
||||
}
|
||||
}
|
||||
|
||||
void UnregistEditorCodes() {
|
||||
// Exclude objects that reference from Editor API
|
||||
var editorcodes = Directory.GetFiles("Assets", "*.*", SearchOption.AllDirectories)
|
||||
.Where(fileName => Path.GetExtension(fileName) == ".cs")
|
||||
.Where(item => Regex.IsMatch(item, "[\\/\\\\]Editor[\\/\\\\]") == true)
|
||||
.ToArray();
|
||||
|
||||
EditorUtility.DisplayProgressBar("checking", "check reference from editor codes", 0.8f);
|
||||
|
||||
foreach (var path in editorcodes) {
|
||||
var code = ClassReferenceCollection.StripComment(File.ReadAllText(path));
|
||||
if (Regex.IsMatch(code, "(\\[MenuItem|AssetPostprocessor|EditorWindow)")) {
|
||||
UnregistFromDelteList(AssetDatabase.AssetPathToGUID(path));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
foreach (var path in editorcodes) {
|
||||
var guid = AssetDatabase.AssetPathToGUID(path);
|
||||
|
||||
if (referenceCollection.Exists(c => c.fileGuid == guid) == false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var referenceGuids = referenceCollection.First(c => c.fileGuid == guid).referenceGids;
|
||||
|
||||
|
||||
|
||||
if (referenceGuids.Any(c => deleteFileList.Contains(c) == true) == false) {
|
||||
UnregistFromDelteList(AssetDatabase.AssetPathToGUID(path));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UnregistFromDelteList(string guid) {
|
||||
if (deleteFileList.Contains(guid) == false) {
|
||||
return;
|
||||
}
|
||||
deleteFileList.Remove(guid);
|
||||
|
||||
if (referenceCollection.Exists(c => c.fileGuid == guid)) {
|
||||
var refInfo = referenceCollection.First(c => c.fileGuid == guid);
|
||||
foreach (var referenceGuid in refInfo.referenceGids) {
|
||||
UnregistFromDelteList(referenceGuid);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+5
-2
@@ -1,7 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 30c0bccb9e30de449a83921c6b801a26
|
||||
guid: 842f43ac94b4b4f72ac0898650ddcc44
|
||||
labels:
|
||||
- ActionGame
|
||||
timeCreated: 1437724265
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
@@ -0,0 +1,58 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using System.Linq;
|
||||
|
||||
public class AssetReferenceCollection : IReferenceCollection {
|
||||
public void Init(List<CollectionData> refs) {
|
||||
references = refs;
|
||||
}
|
||||
|
||||
private List<CollectionData> references = null;
|
||||
|
||||
public void CollectionFiles() {
|
||||
var allFiles = Directory.GetFiles("Assets", "*.*", SearchOption.AllDirectories)
|
||||
.Where(c => Path.GetExtension(c) != ".meta")
|
||||
.Where(c => Path.GetExtension(c) != ".shader")
|
||||
.Where(c => Path.GetExtension(c) != ".cg")
|
||||
.Where(c => Path.GetExtension(c) != ".cginc")
|
||||
.Where(c => Path.GetExtension(c) != ".cs");
|
||||
|
||||
foreach (var file in allFiles) {
|
||||
CollectionReferenceAssets(file);
|
||||
}
|
||||
}
|
||||
|
||||
public void CollectionReferenceAssets(string path) {
|
||||
string guid = AssetDatabase.AssetPathToGUID(path);
|
||||
if (File.Exists(path) == false) { return; }
|
||||
|
||||
string[] referenceFiles = AssetDatabase.GetDependencies(new string[] { path });
|
||||
List<string> referenceList = null;
|
||||
CollectionData reference = null;
|
||||
|
||||
if (references.Exists(c => c.fileGuid == guid) == false) {
|
||||
referenceList = new List<string>();
|
||||
reference = new CollectionData() {
|
||||
fileGuid = guid,
|
||||
referenceGids = referenceList,
|
||||
};
|
||||
references.Add(reference);
|
||||
}
|
||||
else {
|
||||
reference = references.Find(c => c.fileGuid == guid);
|
||||
referenceList = reference.referenceGids;
|
||||
}
|
||||
if (string.IsNullOrEmpty(AssetDatabase.GUIDToAssetPath(guid)) == false) {
|
||||
reference.timeStamp = File.GetLastWriteTime(AssetDatabase.GUIDToAssetPath(guid));
|
||||
}
|
||||
|
||||
foreach (string file in referenceFiles) {
|
||||
if (referenceList.Contains(file) == false)
|
||||
referenceList.Add(AssetDatabase.AssetPathToGUID(file));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+5
-2
@@ -1,7 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4a94c64b69e2e9d42af70e81f06c52a1
|
||||
guid: 805140a4856714e288ea84985d3023df
|
||||
labels:
|
||||
- ActionGame
|
||||
timeCreated: 1438701927
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
@@ -0,0 +1,356 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
using UnityEditor;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace AssetClean {
|
||||
public class ClassReferenceCollection : IReferenceCollection {
|
||||
// guid : types
|
||||
private List<CollectionData> references = null;
|
||||
|
||||
// type : guid
|
||||
private Dictionary<System.Type, List<string>> code2FileDic = new Dictionary<System.Type, List<string>>();
|
||||
private List<TypeDate> fileTypeList = null;
|
||||
public static readonly string xmlPath = "referenceType2File.xml";
|
||||
|
||||
private List<TypeDate> fileTypeXML {
|
||||
get {
|
||||
if (File.Exists(xmlPath) == true) {
|
||||
using (var reader = new StreamReader(xmlPath)) {
|
||||
XmlSerializer serialize = new XmlSerializer(typeof(List<TypeDate>));
|
||||
return (List<TypeDate>)serialize.Deserialize(reader);
|
||||
}
|
||||
}
|
||||
else {
|
||||
return new List<TypeDate>();
|
||||
}
|
||||
}
|
||||
set {
|
||||
using (var writer = new StreamWriter(xmlPath)) {
|
||||
XmlSerializer serialize = new XmlSerializer(typeof(List<TypeDate>));
|
||||
serialize.Serialize(writer, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TypeDate GetTypeData(string guid) {
|
||||
if (fileTypeList.Exists(c => c.guid == guid) == false) {
|
||||
|
||||
var path = AssetDatabase.GUIDToAssetPath(guid);
|
||||
|
||||
fileTypeList.Add(new TypeDate() {
|
||||
guid = guid,
|
||||
fileName = path,
|
||||
timeStamp = File.GetLastWriteTime(path)
|
||||
});
|
||||
}
|
||||
|
||||
return fileTypeList.First(c => c.guid == guid);
|
||||
}
|
||||
|
||||
private bool isSaveEditorCode = false;
|
||||
|
||||
public ClassReferenceCollection(bool saveStiroCode = false) {
|
||||
isSaveEditorCode = saveStiroCode;
|
||||
fileTypeList = fileTypeXML;
|
||||
}
|
||||
|
||||
public void Init(List<CollectionData> refs) {
|
||||
references = refs;
|
||||
}
|
||||
|
||||
public void CollectionFiles() {
|
||||
|
||||
// connect each classes.
|
||||
var firstPassList = new List<string>();
|
||||
if (Directory.Exists("Assets/Plugins"))
|
||||
firstPassList.AddRange(CodeList("Assets/Plugins"));
|
||||
if (Directory.Exists("Assets/Standard Assets"))
|
||||
firstPassList.AddRange(CodeList("Assets/Standard Assets"));
|
||||
|
||||
// Connect the files and class.
|
||||
var codes = CodeList("Assets/").Where(c => firstPassList.Contains(c) == false);
|
||||
|
||||
var allFirstpassTypes = collectionAllFastspassClasses();
|
||||
CollectionCodeFileDictionary(allFirstpassTypes, firstPassList.ToArray());
|
||||
|
||||
var alltypes = CollectionAllClasses();
|
||||
CollectionCodeFileDictionary(alltypes, codes.ToArray());
|
||||
alltypes.AddRange(allFirstpassTypes);
|
||||
|
||||
|
||||
fileTypeXML = fileTypeList;
|
||||
|
||||
foreach (var type in alltypes) {
|
||||
List<string> list = null;
|
||||
if (code2FileDic.ContainsKey(type) == false) {
|
||||
list = new List<string>();
|
||||
code2FileDic.Add(type, list);
|
||||
}
|
||||
else {
|
||||
list = code2FileDic[type];
|
||||
}
|
||||
|
||||
var fullName = type.FullName;
|
||||
var assembly = type.Assembly.FullName;
|
||||
if (fileTypeList.Exists(c => c.assemblly == assembly && c.typeFullName.Contains(fullName))) {
|
||||
var datas = fileTypeList.Where(c => c.assemblly == assembly && c.typeFullName.Contains(fullName));
|
||||
foreach (var data in datas) {
|
||||
list.Add(data.guid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float count = 1, max = firstPassList.Count;
|
||||
foreach (var codepath in firstPassList) {
|
||||
EditorUtility.DisplayProgressBar("analytics", codepath, count++ / max);
|
||||
CollectionReferenceClasses(AssetDatabase.AssetPathToGUID(codepath), allFirstpassTypes);
|
||||
}
|
||||
count = 1;
|
||||
max = codes.Count();
|
||||
foreach (var codepath in codes) {
|
||||
EditorUtility.DisplayProgressBar("analytics", codepath, count++ / max);
|
||||
CollectionReferenceClasses(AssetDatabase.AssetPathToGUID(codepath), alltypes);
|
||||
}
|
||||
|
||||
if (isSaveEditorCode) {
|
||||
CollectionCustomEditorClasses(alltypes);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> CodeList(string path) {
|
||||
string[] codes = Directory.GetFiles(path, "*.cs", SearchOption.AllDirectories);
|
||||
|
||||
List<string> needUpdateFileList = new List<string>();
|
||||
|
||||
foreach (var code in codes) {
|
||||
var guid = AssetDatabase.AssetPathToGUID(code);
|
||||
if (fileTypeList.Exists(c => c.guid == guid) == false) {
|
||||
needUpdateFileList.Add(code);
|
||||
continue;
|
||||
}
|
||||
|
||||
var filetype = GetTypeData(guid);
|
||||
|
||||
var timeStamp = filetype.timeStamp;
|
||||
var time = File.GetLastWriteTime(code);
|
||||
if (time != timeStamp) {
|
||||
filetype.timeStamp = time;
|
||||
needUpdateFileList.Add(code);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return needUpdateFileList;
|
||||
}
|
||||
|
||||
void CollectionCodeFileDictionary(List<System.Type> alltypes, string[] codes) {
|
||||
float count = 1;
|
||||
foreach (var codePath in codes) {
|
||||
EditorUtility.DisplayProgressBar("checking", "search files", count++ / codes.Length);
|
||||
|
||||
// connect file and classes.
|
||||
var code = StripComment(System.IO.File.ReadAllText(codePath));
|
||||
var guid = AssetDatabase.AssetPathToGUID(codePath);
|
||||
|
||||
var typeList = GetTypeData(guid);
|
||||
typeList.typeFullName.Clear();
|
||||
|
||||
foreach (var type in alltypes) {
|
||||
|
||||
if (type.IsNested) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(type.Namespace) == false) {
|
||||
var namespacepattern = string.Format("namespace\\s*{0}[{{\\s\\n]", type.Namespace);
|
||||
if (Regex.IsMatch(code, namespacepattern) == false) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
string typeName = type.IsGenericTypeDefinition ? type.GetGenericTypeDefinition().Name.Split('`')[0] : type.Name;
|
||||
if (type.IsClass) {
|
||||
if (Regex.IsMatch(code, string.Format("class\\s*{0}?[\\s:<{{]", typeName))) {
|
||||
typeList.Add(type);
|
||||
|
||||
var nested = type.GetNestedTypes(BindingFlags.Public | BindingFlags.Instance);
|
||||
|
||||
foreach (var nestedType in nested) {
|
||||
typeList.Add(nestedType);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if (type.IsInterface) {
|
||||
|
||||
if (Regex.IsMatch(code, string.Format("interface\\s*{0}[\\s<{{]", typeName))) {
|
||||
typeList.Add(type);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if (type.IsEnum) {
|
||||
|
||||
if (Regex.IsMatch(code, string.Format("enum\\s*{0}[\\s{{]", type.Name))) {
|
||||
typeList.Add(type);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (Regex.IsMatch(code, string.Format("struct\\s*{0}[\\s:<{{]", typeName))) {
|
||||
typeList.Add(type);
|
||||
continue;
|
||||
}
|
||||
if (Regex.IsMatch(code, string.Format("delegate\\s*{0}\\s\\(", typeName))) {
|
||||
typeList.Add(type);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<System.Type> CollectionAllClasses() {
|
||||
string path = Application.dataPath;
|
||||
string absolutePath = path.Remove(path.Length - 6);
|
||||
List<System.Type> alltypes = new List<System.Type>();
|
||||
if (File.Exists(absolutePath + "Library/ScriptAssemblies/Assembly-CSharp.dll"))
|
||||
alltypes.AddRange(Assembly.LoadFile(absolutePath + "Library/ScriptAssemblies/Assembly-CSharp.dll").GetTypes());
|
||||
if (isSaveEditorCode && File.Exists(absolutePath + "Library/ScriptAssemblies/Assembly-CSharp-Editor.dll"))
|
||||
alltypes.AddRange(Assembly.LoadFile(absolutePath + "Library/ScriptAssemblies/Assembly-CSharp-Editor.dll").GetTypes());
|
||||
|
||||
return alltypes.ToList();
|
||||
}
|
||||
|
||||
List<System.Type> collectionAllFastspassClasses() {
|
||||
string path = Application.dataPath;
|
||||
string absolutePath = path.Remove(path.Length - 6);
|
||||
List<System.Type> alltypes = new List<System.Type>();
|
||||
if (File.Exists(absolutePath + "Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll"))
|
||||
alltypes.AddRange(Assembly.LoadFile(absolutePath + "Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll").GetTypes());
|
||||
if (isSaveEditorCode && File.Exists(absolutePath + "Library/ScriptAssemblies/Assembly-CSharp-Editor-firstpass.dll"))
|
||||
alltypes.AddRange(Assembly.LoadFile(absolutePath + "Library/ScriptAssemblies/Assembly-CSharp-Editor-firstpass.dll").GetTypes());
|
||||
return alltypes;
|
||||
}
|
||||
|
||||
public static string StripComment(string code) {
|
||||
code = Regex.Replace(code, "//.*[\\n\\r]", "");
|
||||
code = Regex.Replace(code, "/\\*.*[\\n\\r]\\*/", "");
|
||||
return code;
|
||||
}
|
||||
|
||||
void CollectionReferenceClasses(string guid, List<System.Type> types) {
|
||||
var codePath = AssetDatabase.GUIDToAssetPath(guid);
|
||||
if (string.IsNullOrEmpty(codePath) || File.Exists(codePath) == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
var code = StripComment(System.IO.File.ReadAllText(codePath));
|
||||
|
||||
List<string> referenceList = null;
|
||||
CollectionData reference = null;
|
||||
|
||||
if (references.Exists(c => c.fileGuid == guid) == false) {
|
||||
referenceList = new List<string>();
|
||||
reference = new CollectionData() {
|
||||
fileGuid = guid,
|
||||
referenceGids = referenceList,
|
||||
};
|
||||
references.Add(reference);
|
||||
}
|
||||
else {
|
||||
reference = references.Find(c => c.fileGuid == guid);
|
||||
referenceList = reference.referenceGids;
|
||||
}
|
||||
|
||||
referenceList.Clear();
|
||||
|
||||
var timestamp = File.GetLastWriteTime(codePath);
|
||||
reference.timeStamp = timestamp;
|
||||
|
||||
foreach (var type in types) {
|
||||
|
||||
if (code2FileDic.ContainsKey(type) == false || code2FileDic[type].Contains(guid)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(type.Namespace) == false) {
|
||||
var namespacepattern = string.Format("([namespace|using][\\s]{0}[{{\\s\\r\\n\\r;]|{0}\\.)", type.Namespace);
|
||||
if (Regex.IsMatch(code, namespacepattern) == false) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
string match = string.Empty;
|
||||
|
||||
if (type.IsGenericTypeDefinition) {
|
||||
string typeName = type.GetGenericTypeDefinition().Name.Split('`')[0];
|
||||
match = string.Format("[!|&\\]\\[\\.\\s<(]{0}[\\.\\s\\n\\r>,<(){{]", typeName);
|
||||
|
||||
}
|
||||
else {
|
||||
string typeName = type.Name.Split('`')[0].Replace("Attribute", "");
|
||||
match = string.Format("[!|&\\]\\[\\.\\s<(]{0}[\\.\\s\\n\\r>,<(){{\\]]", typeName);
|
||||
|
||||
|
||||
// check Extension Methods
|
||||
|
||||
if (Regex.IsMatch(code, string.Format("this\\s{0}\\s", typeName))) {
|
||||
foreach (var file in code2FileDic[type]) {
|
||||
foreach (var baseReference in references.Where(c => c.fileGuid == file)) {
|
||||
baseReference.referenceGids.Add(guid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Regex.IsMatch(code, match)) {
|
||||
var typeGuids = code2FileDic[type];
|
||||
foreach (var typeGuid in typeGuids) {
|
||||
|
||||
if (referenceList.Contains(typeGuid) == false) {
|
||||
referenceList.Add(typeGuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CollectionCustomEditorClasses(IEnumerable<System.Type> types) {
|
||||
foreach (var type in types) {
|
||||
|
||||
if (code2FileDic.ContainsKey(type) == false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var attributes = type.GetCustomAttributes(typeof(CustomEditor), true);
|
||||
foreach (var attribute in attributes) {
|
||||
if (attribute is CustomEditor == false) {
|
||||
continue;
|
||||
}
|
||||
var customEditor = attribute as CustomEditor;
|
||||
var customEditorReferenceTypeField = typeof(CustomEditor).GetField("m_InspectedType", BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
var customEditorReferenceType = (System.Type)customEditorReferenceTypeField.GetValue(customEditor);
|
||||
|
||||
if (code2FileDic.ContainsKey(customEditorReferenceType) == false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach (var filePath in code2FileDic[customEditorReferenceType]) {
|
||||
if (references.Exists(c => c.fileGuid == filePath) == false) {
|
||||
continue;
|
||||
}
|
||||
foreach (var refs in references.Where(c => c.fileGuid == filePath)) {
|
||||
var list = refs.referenceGids;
|
||||
list.AddRange(code2FileDic[type]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 202c278a17939b24c8b79c0ee1f94d8f
|
||||
labels:
|
||||
- ActionGame
|
||||
timeCreated: 1436894500
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,42 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
[System.Serializable]
|
||||
public class CollectionData {
|
||||
public string fileGuid;
|
||||
public string fileName;
|
||||
public List<string> referenceGids = new List<string>();
|
||||
public DateTime timeStamp;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class TypeDate {
|
||||
public string guid;
|
||||
public string fileName;
|
||||
public DateTime timeStamp;
|
||||
public List<string> typeFullName = new List<string>();
|
||||
public string assemblly;
|
||||
|
||||
public void Add(Type addtype) {
|
||||
assemblly = addtype.Assembly.FullName;
|
||||
var typeName = addtype.FullName;
|
||||
if (typeFullName.Contains(typeName) == false) {
|
||||
typeFullName.Add(typeName);
|
||||
}
|
||||
}
|
||||
|
||||
public Type[] types {
|
||||
get {
|
||||
return typeFullName.Select(c => Type.GetType(c)).ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public interface IReferenceCollection {
|
||||
void CollectionFiles();
|
||||
void Init(List<CollectionData> refs);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0d05386265df34bac8d0b6df44aa494c
|
||||
labels:
|
||||
- ActionGame
|
||||
timeCreated: 1438682377
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,214 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace AssetClean {
|
||||
public class FindUnusedAssetsWindow : EditorWindow {
|
||||
AssetCollector collection = new AssetCollector();
|
||||
List<DeleteAsset> deleteAssets = new List<DeleteAsset>();
|
||||
Vector2 scroll;
|
||||
|
||||
[MenuItem("Window/Delete Unused Assets/only resource", false, 50)]
|
||||
static void InitWithoutCode() {
|
||||
var window = FindUnusedAssetsWindow.CreateInstance<FindUnusedAssetsWindow>();
|
||||
window.collection.useCodeStrip = false;
|
||||
window.collection.Collection(new string[] { "Assets" });
|
||||
window.CopyDeleteFileList(window.collection.deleteFileList);
|
||||
|
||||
window.Show();
|
||||
}
|
||||
|
||||
[MenuItem("Window/Delete Unused Assets/unused by editor", false, 51)]
|
||||
static void InitWithout() {
|
||||
var window = FindUnusedAssetsWindow.CreateInstance<FindUnusedAssetsWindow>();
|
||||
window.collection.Collection(new string[] { "Assets" });
|
||||
window.CopyDeleteFileList(window.collection.deleteFileList);
|
||||
|
||||
window.Show();
|
||||
}
|
||||
|
||||
[MenuItem("Window/Delete Unused Assets/unused by game", false, 52)]
|
||||
static void Init() {
|
||||
FindUnusedAssetsWindow window = CreateInstance<FindUnusedAssetsWindow>();
|
||||
window.collection.saveEditorExtensions = false;
|
||||
window.collection.Collection(new string[] { "Assets" });
|
||||
window.CopyDeleteFileList(window.collection.deleteFileList);
|
||||
|
||||
window.Show();
|
||||
}
|
||||
|
||||
// [MenuItem("Assets/Delete Unused Assets/unused by editor", false, 52)]
|
||||
// static void InitAssets ()
|
||||
// {
|
||||
// var paths = Selection.objects
|
||||
// .Select(c=>AssetDatabase.GetAssetPath(c))
|
||||
// .Where(c=>Directory.Exists(c));
|
||||
// if( paths.Any(c=> string.IsNullOrEmpty(c) ) ){
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// var window = FindUnusedAssetsWindow.CreateInstance<FindUnusedAssetsWindow> ();
|
||||
// window.collection.Collection (paths.ToArray());
|
||||
// window.CopyDeleteFileList (window.collection.deleteFileList);
|
||||
//
|
||||
// window.Show ();
|
||||
// }
|
||||
//
|
||||
// [MenuItem("Assets/Delete Unused Assets/unused by editor", true)]
|
||||
// static bool InitAssetsA ()
|
||||
// {
|
||||
// var paths = Selection.objects
|
||||
// .Select(c=>AssetDatabase.GetAssetPath(c))
|
||||
// .Where(c=>Directory.Exists(c));
|
||||
// return ! paths.Any(c=> string.IsNullOrEmpty(c) );
|
||||
// }
|
||||
|
||||
|
||||
|
||||
[MenuItem("Assets/Delete Unused Assets/unused only resources", false, 52)]
|
||||
static void InitAssetsOnlyResources() {
|
||||
var paths = Selection.objects
|
||||
.Select(c => AssetDatabase.GetAssetPath(c))
|
||||
.Where(c => Directory.Exists(c));
|
||||
if (paths.Any(c => string.IsNullOrEmpty(c))) {
|
||||
return;
|
||||
}
|
||||
|
||||
var window = FindUnusedAssetsWindow.CreateInstance<FindUnusedAssetsWindow>();
|
||||
window.collection.useCodeStrip = false;
|
||||
window.collection.Collection(paths.ToArray());
|
||||
window.CopyDeleteFileList(window.collection.deleteFileList);
|
||||
|
||||
window.Show();
|
||||
}
|
||||
[MenuItem("Assets/Delete Unused Assets/unused only resources", true)]
|
||||
static bool InitAssetsOnlyResourcesA() {
|
||||
var paths = Selection.objects
|
||||
.Select(c => AssetDatabase.GetAssetPath(c))
|
||||
.Where(c => Directory.Exists(c));
|
||||
return !paths.Any(c => string.IsNullOrEmpty(c));
|
||||
}
|
||||
|
||||
[MenuItem("Window/Delete Unused Assets/Clear cache")]
|
||||
static void ClearCache() {
|
||||
File.Delete(AssetClean.AssetCollector.exportXMLPath);
|
||||
File.Delete(AssetClean.ClassReferenceCollection.xmlPath);
|
||||
|
||||
EditorUtility.DisplayDialog("clear file", "clear file", "OK");
|
||||
}
|
||||
|
||||
|
||||
void OnGUI() {
|
||||
using (var horizonal = new EditorGUILayout.HorizontalScope("box")) {
|
||||
EditorGUILayout.LabelField("delete unreference assets from buildsettings and resources");
|
||||
}
|
||||
|
||||
using (var scrollScope = new EditorGUILayout.ScrollViewScope(scroll)) {
|
||||
scroll = scrollScope.scrollPosition;
|
||||
foreach (var asset in deleteAssets) {
|
||||
if (string.IsNullOrEmpty(asset.path)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
using (var horizonal = new EditorGUILayout.HorizontalScope()) {
|
||||
asset.isDelete = EditorGUILayout.Toggle(asset.isDelete, GUILayout.Width(20));
|
||||
var icon = AssetDatabase.GetCachedIcon(asset.path);
|
||||
GUILayout.Label(icon, GUILayout.Width(20), GUILayout.Height(20));
|
||||
if (GUILayout.Button(asset.path, EditorStyles.largeLabel)) {
|
||||
Selection.activeObject = AssetDatabase.LoadAssetAtPath<Object>(asset.path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
using (var horizonal = new EditorGUILayout.HorizontalScope("box")) {
|
||||
EditorGUILayout.Space();
|
||||
if (GUILayout.Button("Exclude from Project", GUILayout.Width(160)) && deleteAssets.Count != 0) {
|
||||
EditorApplication.delayCall += Exclude;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Exclude() {
|
||||
RemoveFiles();
|
||||
Close();
|
||||
}
|
||||
|
||||
static void CleanDir() {
|
||||
RemoveEmptyDirectry("Assets");
|
||||
AssetDatabase.Refresh();
|
||||
}
|
||||
|
||||
void CopyDeleteFileList(IEnumerable<string> deleteFileList) {
|
||||
foreach (var asset in deleteFileList) {
|
||||
var filePath = AssetDatabase.GUIDToAssetPath(asset);
|
||||
if (string.IsNullOrEmpty(filePath) == false) {
|
||||
deleteAssets.Add(new DeleteAsset() { path = filePath });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RemoveFiles() {
|
||||
try {
|
||||
string exportDirectry = "BackupUnusedAssets";
|
||||
Directory.CreateDirectory(exportDirectry);
|
||||
var files = deleteAssets.Where(item => item.isDelete == true).Select(item => item.path).ToArray();
|
||||
string backupPackageName = exportDirectry + "/package" + System.DateTime.Now.ToString("yyyyMMddHHmmss") + ".unitypackage";
|
||||
EditorUtility.DisplayProgressBar("export package", backupPackageName, 0);
|
||||
|
||||
AssetDatabase.ExportPackage(files, backupPackageName);
|
||||
|
||||
int i = 0;
|
||||
int length = deleteAssets.Count;
|
||||
|
||||
foreach (var assetPath in files) {
|
||||
i++;
|
||||
EditorUtility.DisplayProgressBar("delete unused assets", assetPath, (float)i / length);
|
||||
AssetDatabase.DeleteAsset(assetPath);
|
||||
if (File.Exists(assetPath)) {
|
||||
File.Delete(assetPath);
|
||||
}
|
||||
}
|
||||
|
||||
EditorUtility.DisplayProgressBar("clean directory", "", 1);
|
||||
foreach (var dir in Directory.GetDirectories("Assets")) {
|
||||
RemoveEmptyDirectry(dir);
|
||||
}
|
||||
|
||||
System.Diagnostics.Process.Start(exportDirectry);
|
||||
|
||||
AssetDatabase.Refresh();
|
||||
}
|
||||
catch (System.Exception e) {
|
||||
Debug.Log(e.Message);
|
||||
} finally {
|
||||
EditorUtility.ClearProgressBar();
|
||||
}
|
||||
}
|
||||
|
||||
static void RemoveEmptyDirectry(string path) {
|
||||
var dirs = Directory.GetDirectories(path);
|
||||
foreach (var dir in dirs) {
|
||||
RemoveEmptyDirectry(dir);
|
||||
}
|
||||
|
||||
|
||||
var files = Directory.GetFiles(path, "*", SearchOption.TopDirectoryOnly).Where(item => Path.GetExtension(item) != ".meta");
|
||||
if (files.Count() == 0 && Directory.GetDirectories(path).Count() == 0) {
|
||||
var metaFile = AssetDatabase.GetTextMetaFilePathFromAssetPath(path);
|
||||
UnityEditor.FileUtil.DeleteFileOrDirectory(path);
|
||||
UnityEditor.FileUtil.DeleteFileOrDirectory(metaFile);
|
||||
}
|
||||
}
|
||||
|
||||
class DeleteAsset {
|
||||
public bool isDelete = true;
|
||||
public string path;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 74eec3bfba0594259ac2843353c082a3
|
||||
labels:
|
||||
- ActionGame
|
||||
timeCreated: 1437724294
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,95 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using UnityEditor;
|
||||
|
||||
namespace AssetClean {
|
||||
public class ShaderReferenceCollection : IReferenceCollection {
|
||||
// shader name / shader file guid
|
||||
public Dictionary<string, string> shaderFileList = new Dictionary<string, string>();
|
||||
private List<CollectionData> references = new List<CollectionData>();
|
||||
|
||||
public void Init(List<CollectionData> refs) {
|
||||
references = refs;
|
||||
}
|
||||
|
||||
public void CollectionFiles() {
|
||||
CollectionShaderFiles();
|
||||
CheckReference();
|
||||
}
|
||||
|
||||
void CollectionShaderFiles() {
|
||||
var shaderFiles = Directory.GetFiles("Assets", "*.shader", SearchOption.AllDirectories);
|
||||
foreach (var shaderFilePath in shaderFiles) {
|
||||
var code = File.ReadAllText(shaderFilePath);
|
||||
var match = Regex.Match(code, "Shader \"(?<name>.*)\"");
|
||||
if (match.Success) {
|
||||
var shaderName = match.Groups["name"].ToString();
|
||||
if (shaderFileList.ContainsKey(shaderName) == false) {
|
||||
shaderFileList.Add(shaderName, AssetDatabase.AssetPathToGUID(shaderFilePath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var cgFiles = Directory.GetFiles("Assets", "*.cg", SearchOption.AllDirectories);
|
||||
foreach (var cgFilePath in cgFiles) {
|
||||
var file = Path.GetFileName(cgFilePath);
|
||||
shaderFileList.Add(file, cgFilePath);
|
||||
}
|
||||
|
||||
var cgincFiles = Directory.GetFiles("Assets", "*.cginc", SearchOption.AllDirectories);
|
||||
foreach (var cgincPath in cgincFiles) {
|
||||
var file = Path.GetFileName(cgincPath);
|
||||
if (shaderFileList.ContainsKey(file) == false) {
|
||||
shaderFileList.Add(file, cgincPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CheckReference() {
|
||||
foreach (var shader in shaderFileList) {
|
||||
var shaderFilePath = AssetDatabase.GUIDToAssetPath(shader.Value);
|
||||
if (File.Exists(shaderFilePath) == false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var guid = shader.Value;
|
||||
|
||||
List<string> referenceList = null;
|
||||
CollectionData reference = null;
|
||||
|
||||
if (references.Exists(c => c.fileGuid == guid) == false) {
|
||||
referenceList = new List<string>();
|
||||
reference = new CollectionData() {
|
||||
fileGuid = guid,
|
||||
referenceGids = referenceList,
|
||||
};
|
||||
references.Add(reference);
|
||||
}
|
||||
else {
|
||||
reference = references.Find(c => c.fileGuid == guid);
|
||||
referenceList = reference.referenceGids;
|
||||
}
|
||||
|
||||
reference.timeStamp = File.GetLastWriteTime(AssetDatabase.GUIDToAssetPath(guid));
|
||||
|
||||
var code = ClassReferenceCollection.StripComment(File.ReadAllText(shaderFilePath));
|
||||
|
||||
foreach (var checkingShaderName in shaderFileList.Keys) {
|
||||
if (checkingShaderName == shader.Key) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (code.IndexOf(checkingShaderName) != -1 && shaderFileList.ContainsKey(checkingShaderName)) {
|
||||
var fileGuid = shaderFileList[checkingShaderName];
|
||||
if (referenceList.Contains(fileGuid) == false) {
|
||||
referenceList.Add(fileGuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2c4f01a79a77a45a9a84004cc2b78098
|
||||
labels:
|
||||
- ActionGame
|
||||
timeCreated: 1437706430
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 110 KiB |
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f75bdc790e79d614fb98c56758986133
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7c43e3064b5a87a43bb1545c5cecf93e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,150 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &2282457566440489139
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2000843579383799871}
|
||||
- component: {fileID: 2332360223713012105}
|
||||
m_Layer: 5
|
||||
m_Name: LabelController
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &2000843579383799871
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2282457566440489139}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 4366520896438658900}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &2332360223713012105
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2282457566440489139}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f7eb8180a2e59e44f94464ec35f42b5f, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
parent: {fileID: 4366520896438658900}
|
||||
labelPrefab: {fileID: 2682401737700228647, guid: 10d433e31ddc82941b7939b1f41d6121, type: 3}
|
||||
--- !u!1 &5990839265172870881
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4366520896438658900}
|
||||
- component: {fileID: 1585856385847655300}
|
||||
- component: {fileID: 8368974480207407461}
|
||||
- component: {fileID: 8442284695854397385}
|
||||
m_Layer: 5
|
||||
m_Name: Canvas
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &4366520896438658900
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5990839265172870881}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0.01, y: 0.01, z: 0.01}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2000843579383799871}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!223 &1585856385847655300
|
||||
Canvas:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5990839265172870881}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_RenderMode: 2
|
||||
m_Camera: {fileID: 0}
|
||||
m_PlaneDistance: 100
|
||||
m_PixelPerfect: 0
|
||||
m_ReceivesEvents: 1
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_VertexColorAlwaysGammaSpace: 0
|
||||
m_AdditionalShaderChannelsFlag: 0
|
||||
m_UpdateRectTransformForStandalone: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_TargetDisplay: 0
|
||||
--- !u!114 &8368974480207407461
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5990839265172870881}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_UiScaleMode: 0
|
||||
m_ReferencePixelsPerUnit: 100
|
||||
m_ScaleFactor: 1
|
||||
m_ReferenceResolution: {x: 800, y: 600}
|
||||
m_ScreenMatchMode: 0
|
||||
m_MatchWidthOrHeight: 0
|
||||
m_PhysicalUnit: 3
|
||||
m_FallbackScreenDPI: 96
|
||||
m_DefaultSpriteDPI: 96
|
||||
m_DynamicPixelsPerUnit: 1
|
||||
m_PresetInfoIsWorld: 1
|
||||
--- !u!114 &8442284695854397385
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5990839265172870881}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreReversedGraphics: 1
|
||||
m_BlockingObjects: 0
|
||||
m_BlockingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0d8274e243a195247b4a0af03313fe9e
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,92 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &2682401737700228647
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6596866004371516906}
|
||||
- component: {fileID: 1065646644802001410}
|
||||
- component: {fileID: 722418660642648614}
|
||||
- component: {fileID: 9169447819909638997}
|
||||
m_Layer: 5
|
||||
m_Name: LabelFollower
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &6596866004371516906
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2682401737700228647}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 100, y: 100}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &1065646644802001410
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2682401737700228647}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &722418660642648614
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2682401737700228647}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &9169447819909638997
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2682401737700228647}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 485994f2ed6f1e448bea192023877815, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
target: {fileID: 0}
|
||||
offset: {x: 0, y: 0, z: 0}
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 10d433e31ddc82941b7939b1f41d6121
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,124 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &1923445833930100383
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 890709262476161389}
|
||||
- component: {fileID: 8481589867913543187}
|
||||
- component: {fileID: 5206270052993606331}
|
||||
- component: {fileID: 2980283788531929614}
|
||||
- component: {fileID: 783073813159188321}
|
||||
m_Layer: 0
|
||||
m_Name: StandardLabel
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &890709262476161389
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1923445833930100383}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0.5, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &8481589867913543187
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1923445833930100383}
|
||||
m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &5206270052993606331
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1923445833930100383}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!136 &2980283788531929614
|
||||
CapsuleCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1923445833930100383}
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_IsTrigger: 0
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Radius: 0.5
|
||||
m_Height: 2
|
||||
m_Direction: 1
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &783073813159188321
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1923445833930100383}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 30c0bccb9e30de449a83921c6b801a26, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
labelPrefab: {fileID: 2682401737700228647, guid: 10d433e31ddc82941b7939b1f41d6121, type: 3}
|
||||
offset: {x: 0, y: 1.5, z: 0}
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9df2d2c64a5c06245be7e81572bcfe4e
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dcead9d9ef85f5d47a0bae343e1aba10
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,20 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using MuHua;
|
||||
|
||||
namespace MuHua.Sample {
|
||||
public class StandardLabel : MonoBehaviour {
|
||||
public GameObject labelPrefab;
|
||||
public Vector3 offset = new Vector3(0, 1, 0);
|
||||
private GameObject labelObject;
|
||||
|
||||
void Start() {
|
||||
// labelObject = FollowerController.CreateLabel(transform, labelPrefab, offset);
|
||||
}
|
||||
void OnDestroy() {
|
||||
if (labelObject != null) { Destroy(labelObject); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6d1bcd63c2c24d540bc4736439c8dc7d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,22 +0,0 @@
|
||||
@import url("unity-theme://default");
|
||||
|
||||
@import url("/Assets/ModuleMuHua/UITool/FontLibrary/Fonts.uss");
|
||||
@import url("/Assets/ModuleMuHua/UITool/USS/InputField.uss");
|
||||
@import url("/Assets/ModuleMuHua/UITool/USS/Scroller.uss");
|
||||
@import url("/Assets/ModuleMuHua/UITool/USS/ScrollView.uss");
|
||||
@import url("/Assets/ModuleMuHua/UITool/USS/Slider.uss");
|
||||
@import url("/Assets/ModuleMuHua/UITool/USS/Window.uss");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
VisualElement {}
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 79a59b79f3428b449916c4b458f73e78
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 821f2aa73c2761649a4466ee441ad752
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user