删除无用文件

This commit is contained in:
2025-03-31 10:20:59 +08:00
parent ab4a25a35b
commit 24a39ccf23
207 changed files with 3 additions and 6911 deletions

View File

@@ -10,14 +10,14 @@ stages:
# 发布
job_deploy:
only:
- master
- 03.FiniteStateMachine
stage: deploy
tags:
- staryEvo
before_script:
- echo '开始发布'
script:
- cd Assets/02.InformationSave
- cd Assets/03.FiniteStateMachine
# 获取当前版本
- CURRENT_VERSION=$(node -p "require('./package.json').version")
# - echo " ProjectID ${CI_SERVER_HOST}"

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 3f870b72f09a15d46a4e87a835910aff
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,116 +0,0 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
namespace wvdet.CodeChecker
{
public static class CheckerUtils
{
public static List<Result> CheckCodes()
{
var checkables = new List<ICheckable>
{
new CheckNamespace(),
new CheckClass(),
new CheckEnum(),
new CheckInterface(),
new CheckStruct(),
};
var results = new List<Result>();
var files = Directory.GetFiles("Assets", "*.cs", SearchOption.AllDirectories).Select(x => x.Replace("\\", "/"))
.ToList();
// files.Clear();
// files.Add(@"Assets\Hotfix\Scripts\_Table\Dubbing.cs");
foreach (var filepath in files)
{
if (IsUncheckFile(filepath))
continue;
var result = new Result();
var root = CSharpSyntaxTree.ParseText(File.ReadAllText(filepath)).GetCompilationUnitRoot();
checkables.ForEach(x => result.details.AddRange(x.Check(filepath, root)));
if (result.details.Count > 0)
{
result.filepath = filepath;
result.warningCount = result.details.Count(x => x.level == Level.Warning);
result.errorCount = result.details.Count(x => x.level == Level.Error);
result.details.Sort((a, b) => (int)b.level - (int)a.level);
results.Add(result);
}
}
return results;
}
public static bool IsUncheckFile(string filepath)
{
//将不需要检查的代码过滤
//示例: if (Path.GetFileName(filepath) == "Res.cs")
// return true;
return false;
}
public static string ConvertPascalCase(string name)
{
if (!name.Contains(" "))
{
name = Regex.Replace(name, "(?<=[a-z])(?=[A-Z])", " ");
}
string s = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(name.ToLower())
.Replace(" ", "").Replace("_", "");
return s;
}
public static bool IsChineseIdentifier(string identifier, int lineNumber, out Detail detail)
{
detail = null;
if (Regex.IsMatch(identifier, "[\u4e00-\u9fbb]"))
{
detail = new Detail
{
line = lineNumber,
guideline = "禁止使用中文命名",
};
return true;
}
return false;
}
/// <summary>
/// 获取Field的Identifier
/// </summary>
public static SyntaxToken GetIdentifier(this FieldDeclarationSyntax self)
{
var variableDec = self.DescendantNodes().OfType<VariableDeclarationSyntax>().FirstOrDefault();
var declarator = variableDec?.DescendantNodes().OfType<VariableDeclaratorSyntax>().FirstOrDefault();
return declarator.Identifier;
}
public static PredefinedTypeSyntax GetPredefined(this FieldDeclarationSyntax self)
{
var variableDec = self.DescendantNodes().OfType<VariableDeclarationSyntax>().FirstOrDefault();
return variableDec?.DescendantNodes().OfType<PredefinedTypeSyntax>().FirstOrDefault();
}
public static string GetFieldGreenText(this FieldDeclarationSyntax self)
{
var sb = new StringBuilder();
self.Modifiers.ToList().ForEach(m => sb.Append($"{m.Text.Trim()} "));
sb.Append(self.Declaration.GetText().ToString().Trim());
return sb.ToString();
}
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 4691f4d638344f76bcf364f2360ccc54
timeCreated: 1627456394

View File

@@ -1,181 +0,0 @@
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace wvdet.CodeChecker
{
public class CodeChecker : EditorWindow
{
private Vector2 _scroll;
private int _warningCount;
private int _errorCount;
private GUIStyle kLabelStyle;
private GUIStyle kHintStyle;
private GUIStyle kSuggestionStyle;
private GUIStyle kWarningStyle;
private GUIStyle kErrorStyle;
private GUIStyle kWaitingStyle;
private GUIStyle kWonderfulStyle;
private static GUIContent _sceneIcon;
public List<Result> Results { get; set; }
private static GUIContent scriptIcon => _sceneIcon ?? (_sceneIcon = EditorGUIUtility.IconContent("d_cs Script Icon"));
[MenuItem("Evo/Utility/优化/代码检查", false, 30)]
public static void TopMenuItem()
{
var wnd = GetWindow<CodeChecker>();
wnd.titleContent = new GUIContent("代码检查");
wnd.minSize = new Vector2(800f, 600f);
EditorApplication.delayCall += () => { wnd.UpdateResults(); };
}
public void UpdateResults()
{
EditorUtility.DisplayProgressBar("", "代码检查中...", 0);
Results = CheckerUtils.CheckCodes();
Results.ForEach(result => { _errorCount += result.errorCount; });
Results.ForEach(result => { _warningCount += result.warningCount; });
EditorUtility.ClearProgressBar();
}
private void OnGUI()
{
if (kLabelStyle == null)
InitGuiStyles();
EditorGUILayout.Separator();
if (GUILayout.Button("检 查", GUILayout.Height(25)))
UpdateResults();
if (Results == null)
DrawWaitingTip();
else if (Results.Count > 0)
DrawAllResults();
else
DrawWonderfulTip();
}
private void DrawAllResults()
{
EditorGUILayout.Separator();
DrawLabel($"错误:{_errorCount}\t\t警告: {_warningCount}");
_scroll = GUILayout.BeginScrollView(_scroll, GUILayout.Height(position.height - 40));
{
GUI.skin.button.alignment = TextAnchor.UpperLeft;
{
foreach (var result in Results)
{
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
{
scriptIcon.text = $"{result.filepath} \t\t (Warning: {result.warningCount} Error: {result.errorCount})";
if (GUILayout.Button(scriptIcon, EditorStyles.linkLabel, GUILayout.Height(20)))
EditorGUIUtility.PingObject(AssetDatabase.LoadAssetAtPath(result.filepath, typeof(Object)));
for (int i = 0; i < result.details.Count; i++)
{
if (i >= 1)
DrawGUILine();
DrawResultDetail(result.details[i]);
if (i < result.details.Count - 1)
EditorGUILayout.Separator();
}
}
EditorGUILayout.EndVertical();
EditorGUILayout.Separator();
}
}
GUI.skin.button.alignment = TextAnchor.MiddleCenter;
}
GUILayout.EndScrollView();
}
private void DrawResultDetail(Detail detail)
{
var style = GetLevelStyle(detail.level);
if (!string.IsNullOrWhiteSpace(detail.guideline))
DrawLabel($"规则: {detail.guideline}", style);
if (detail.line > 0)
DrawLabel($"行号: {detail.line}");
if (!string.IsNullOrWhiteSpace(detail.codeSnippet))
EditorGUILayout.LabelField($"当前: {detail.codeSnippet}", kLabelStyle);
// DrawLabel($"当前: {detail.codeSnippet}");
if (!string.IsNullOrWhiteSpace(detail.suggestion))
DrawLabel($"建议: {detail.suggestion}", kSuggestionStyle);
}
private void DrawWaitingTip()
{
EditorGUILayout.LabelField("无检查记录,请重新检查", kWaitingStyle, GUILayout.Height(150f));
}
private void DrawWonderfulTip()
{
EditorGUILayout.LabelField("未检测出不规范的地方\n继续加油", kWonderfulStyle, GUILayout.Height(150f));
}
private GUIStyle GetLevelStyle(Level level)
{
var style = kLabelStyle;
if (level == Level.Hint)
style = kHintStyle;
else if (level == Level.Warning)
style = kWarningStyle;
else if (level == Level.Error)
style = kErrorStyle;
return style;
}
private void DrawLabel(string text, GUIStyle style = null)
{
// EditorGUILayout.SelectableLabel($"{space}{text}", style ?? kNormalStyle, GUILayout.Height(16f));
EditorGUILayout.LabelField(text, style ?? kLabelStyle, GUILayout.Height(16f));
}
private void InitGuiStyles()
{
kLabelStyle = new GUIStyle(EditorStyles.label);
kLabelStyle.fontSize = 12;
// kLabelStyle.wordWrap = false;
kHintStyle = new GUIStyle(kLabelStyle);
kHintStyle.normal.textColor = Color.cyan;
kSuggestionStyle = new GUIStyle(kLabelStyle);
kSuggestionStyle.normal.textColor = Color.green;
kWarningStyle = new GUIStyle(kLabelStyle);
kWarningStyle.normal.textColor = Color.yellow;
kErrorStyle = new GUIStyle(kLabelStyle);
kErrorStyle.normal.textColor = Color.red;
kWaitingStyle = new GUIStyle(EditorStyles.label);
kWaitingStyle.fontSize = 30;
kWaitingStyle.fontStyle = FontStyle.Bold;
kWaitingStyle.alignment = TextAnchor.MiddleCenter;
kWaitingStyle.normal.textColor = Color.grey;
kWonderfulStyle = new GUIStyle(kWaitingStyle);
kWonderfulStyle.normal.textColor = Color.green;
}
public static void DrawGUILine(int height = 1)
{
Rect rect = EditorGUILayout.GetControlRect(false, height);
rect.height = height;
EditorGUI.DrawRect(rect, new Color(0.5f, 0.5f, 0.5f, 1));
}
}
}

View File

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

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: a1c305bad13a4da2b613bc6534e42ed6
timeCreated: 1627433004

View File

@@ -1,267 +0,0 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using UnityEngine;
namespace wvdet.CodeChecker
{
/// <summary>
/// Class [类] 命名规范
/// 使用 Pascal Case。
/// 使用名词或者名词性词组命名。
/// 文件名应和类名相同。
/// 不要轻易使用缩写。
/// 不使用type前缀。
/// 比如C来标识Class。
/// 比如使用FileStream而不是CFileStream。
/// 不使用下划线。
/// 在合适的时候,使用单词复合来标识从某个基类继承而来。
/// 比如xxxException。
/// 同一功能下,可以考虑同一命名前缀。
/// </summary>
public class CheckClass : ICheckable
{
public List<Detail> Check(string filepath, CompilationUnitSyntax root)
{
var results = new List<Detail>();
var classDecs = root.DescendantNodes().OfType<ClassDeclarationSyntax>().ToList();
foreach (var dec in classDecs)
{
CheckClassName(dec, results);
CheckProperty(dec, results);
CheckField(dec, results);
CheckMethod(dec, results);
}
var filename = Path.GetFileNameWithoutExtension(filepath);
if (classDecs.Count > 0 && classDecs.All(x => x.Identifier.ValueText != filename))
{
results.Add(new Detail
{
level = Level.Warning,
guideline = "文件名应和类名相同",
});
}
return results;
}
private static void CheckClassName(ClassDeclarationSyntax dec, List<Detail> results)
{
var identifier = dec.Identifier.ValueText;
var lineNumber = dec.GetLocation().GetLineSpan().StartLinePosition.Line;
if (CheckerUtils.IsChineseIdentifier(identifier, lineNumber, out var ret))
results.Add(ret);
if (char.IsLower(identifier[0]))
{
results.Add(new Detail
{
level = Level.Warning,
line = lineNumber,
codeSnippet = identifier.Trim(),
suggestion = CheckerUtils.ConvertPascalCase(identifier),
guideline = "类名必须使用PascalCase",
});
}
if (identifier[0] == '_')
{
results.Add(new Detail
{
level = Level.Error,
line = lineNumber,
codeSnippet = identifier.Trim(),
suggestion = CheckerUtils.ConvertPascalCase(identifier.Substring(1)),
guideline = "类名禁用以下划线开始",
});
}
}
/// <summary>
/// Static Field [静态变量] 命名规范
/// 使用 Pascal Case。
/// 使用名词、名词性词组或者名词地缩写来命名静态变量。
/// 不要在静态变量名称中使用匈牙利命名法[变量名=属性+类型+对象描述]。
/// 在任何可能的情况下推荐你使用静态properties[属性]而不是public static fields。
/// </summary>
private static void CheckField(ClassDeclarationSyntax dec, List<Detail> results)
{
var fields = dec.DescendantNodes().OfType<FieldDeclarationSyntax>();
foreach (var field in fields)
{
var modifiers = field.Modifiers;
var isConst = modifiers.Any(x => x.IsKind(SyntaxKind.ConstKeyword));
var isPublic = modifiers.Any(x => x.IsKind(SyntaxKind.PublicKeyword));
var isStatic = modifiers.Any(x => x.IsKind(SyntaxKind.StaticKeyword));
var identifier = field.GetIdentifier().ValueText;
var lineNumber = field.GetLocation().GetLineSpan().StartLinePosition.Line;
if (CheckerUtils.IsChineseIdentifier(identifier, lineNumber, out var ret))
results.Add(ret);
if (isConst)
{
if (identifier.Any(char.IsLower))
results.Add(new Detail
{
level = Level.Error,
line = lineNumber,
codeSnippet = field.GetFieldGreenText(),
guideline = "Const Field[常量]全大写命名下划线分隔。例如SCENE_CAMERA。",
});
continue;
}
if (isPublic)
{
if (isStatic && char.IsLower(identifier[0]))
{
results.Add(new Detail
{
level = Level.Error,
line = lineNumber,
codeSnippet = field.GetFieldGreenText(),
guideline = "public静态变量首字母必须大写",
});
}
else if (!isStatic && char.IsUpper(identifier[0]))
{
results.Add(new Detail
{
level = Level.Error,
line = lineNumber,
codeSnippet = field.GetFieldGreenText(),
guideline = "public字段首字母必须小写",
});
}
}
else //私有
{
if (char.IsUpper(identifier[0]))
{
results.Add(new Detail
{
level = Level.Error,
line = lineNumber,
codeSnippet = field.GetFieldGreenText(),
guideline = "private及protected字段首字母必须小写",
});
}
var declarator = field.GetPredefined();
if (declarator != null)
{
if (declarator.Keyword.IsKind(SyntaxKind.BoolKeyword) &&
(identifier.Length < 3 || !identifier.StartsWith("is")))
{
results.Add(new Detail
{
level = Level.Warning,
line = lineNumber,
codeSnippet = field.GetFieldGreenText(),
guideline = "private及protected布尔字段应以is开始如isFileFound",
});
}
}
if (identifier.TrimStart('_').Contains('_'))
{
results.Add(new Detail
{
level = Level.Warning,
line = lineNumber,
codeSnippet = field.GetFieldGreenText(),
guideline = "private及protected中间不使用下划线(如isPlayer)",
});
}
}
}
}
private static void CheckMethod(ClassDeclarationSyntax dec, List<Detail> results)
{
var methods = dec.DescendantNodes().OfType<MethodDeclarationSyntax>();
foreach (var method in methods)
{
var identifier = method.Identifier.ValueText;
var lineNumber = method.GetLocation().GetLineSpan().StartLinePosition.Line;
if (CheckerUtils.IsChineseIdentifier(identifier, lineNumber, out var ret))
results.Add(ret);
if (!char.IsUpper(identifier[0]))
{
results.Add(new Detail
{
level = Level.Error,
line = lineNumber,
codeSnippet = identifier.Trim(),
suggestion = CheckerUtils.ConvertPascalCase(identifier),
guideline = "方法名必须使用PascalCase",
});
}
method.ParameterList.Parameters.ToList().ForEach(parameter =>
{
var parameterName = parameter.Identifier.ValueText;
if (CheckerUtils.IsChineseIdentifier(parameterName, lineNumber, out var ret2))
results.Add(ret2);
if (!char.IsLower(parameterName[0]))
{
results.Add(new Detail
{
level = Level.Error,
line = lineNumber,
codeSnippet = parameter.GetText().ToString().Trim(),
guideline = "方法参数名必须使用小写字母开始",
});
}
if (identifier.Contains('_'))
{
results.Add(new Detail
{
level = Level.Error,
line = lineNumber,
codeSnippet = parameter.GetText().ToString().Trim(),
guideline = "方法参数名禁止包含下划线(_)",
});
}
});
}
}
private static void CheckProperty(ClassDeclarationSyntax dec, List<Detail> results)
{
var properties = dec.DescendantNodes().OfType<PropertyDeclarationSyntax>();
foreach (var property in properties)
{
var identifier = property.Identifier.ValueText;
var lineNumber = property.GetLocation().GetLineSpan().StartLinePosition.Line;
if (CheckerUtils.IsChineseIdentifier(identifier, lineNumber, out var ret))
results.Add(ret);
if (!char.IsUpper(identifier[0]))
{
results.Add(new Detail
{
level = Level.Error,
line = lineNumber,
codeSnippet = property.GetText().ToString().Trim(),
suggestion = CheckerUtils.ConvertPascalCase(identifier),
guideline = "属性名须使用Camel Case命名",
});
}
}
}
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 9e1aa528e5c547b19c2aa56a2ea6f9d9
timeCreated: 1627451393

View File

@@ -1,80 +0,0 @@
using System.Collections.Generic;
using System.Linq;
using Microsoft.CodeAnalysis.CSharp.Syntax;
namespace wvdet.CodeChecker
{
/// <summary>
/// Enumeration Type [枚举] 命名规范
/// 使用 Pascal Case。
/// 不要在Enum类型名称后面加上Enum后缀。(自己定义其他后缀)
/// 对于大多数Enum类型使用单数名称仅仅在这个Enum类型是位域地时候使用复数形式。
/// 如果是用于位域的枚举那么结尾加上FlagsAttribute。
/// </summary>
public class CheckEnum : ICheckable
{
public List<Detail> Check(string filepath, CompilationUnitSyntax root)
{
var results = new List<Detail>();
var enumDecls = root.DescendantNodes().OfType<EnumDeclarationSyntax>();
foreach (var dec in enumDecls)
{
var identifier = dec.Identifier.ValueText;
var lineNumber = dec.GetLocation().GetLineSpan().StartLinePosition.Line;
if (CheckerUtils.IsChineseIdentifier(identifier, lineNumber, out var ret))
results.Add(ret);
if (char.IsLower(identifier[0]))
{
results.Add(new Detail
{
level = Level.Error,
line = lineNumber,
codeSnippet = identifier.Trim(),
suggestion = CheckerUtils.ConvertPascalCase(identifier),
guideline = "枚举类型名必须使用PascalCase",
});
}
if (identifier[0] == 'I')
{
results.Add(new Detail
{
level = Level.Warning,
line = lineNumber,
codeSnippet = identifier.Trim(),
suggestion = CheckerUtils.ConvertPascalCase("I" + identifier),
guideline = "在interface名称前加上字母I来表示type是interface。(如ICinfig)",
});
}
if (identifier[0] == '_')
{
results.Add(new Detail
{
level = Level.Error,
line = lineNumber,
codeSnippet = identifier.Trim(),
suggestion = CheckerUtils.ConvertPascalCase(identifier.Substring(1)),
guideline = "枚举类型名禁用以下划线开始",
});
}
if (identifier.EndsWith("Enum"))
{
results.Add(new Detail
{
level = Level.Error,
line = lineNumber,
codeSnippet = identifier.Trim(),
guideline = "不要在Enum类型名称后面加上Enum后缀。(自己定义其他后缀)",
});
}
}
return results;
}
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 596a7b1543c54c8c8263ffd334c191d6
timeCreated: 1627456962

View File

@@ -1,82 +0,0 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.CodeAnalysis.CSharp.Syntax;
namespace wvdet.CodeChecker
{
/// <summary>
/// Interface [接口] 命名规范
/// 使用 Pascal Case。
/// 使用名词或者名词性词组命名接口。
/// 不要轻易使用缩写。
/// 在interface 名称前加上字母I来表示type是interface。(如ICinfig)
/// 不使用下划线。
/// 文件名应和类名相同。
/// </summary>
public class CheckInterface : ICheckable
{
public List<Detail> Check(string filepath, CompilationUnitSyntax root)
{
var results = new List<Detail>();
var interfaceDecs = root.DescendantNodes().OfType<InterfaceDeclarationSyntax>().ToList();
foreach (var dec in interfaceDecs)
{
var identifier = dec.Identifier.ValueText;
var lineNumber = dec.GetLocation().GetLineSpan().StartLinePosition.Line;
if (CheckerUtils.IsChineseIdentifier(identifier, lineNumber, out var ret))
results.Add(ret);
if (!char.IsLower(identifier[0]))
{
results.Add(new Detail
{
level = Level.Error,
line = lineNumber,
codeSnippet = identifier.Trim(),
suggestion = CheckerUtils.ConvertPascalCase(identifier),
guideline = "接口类型名必须使用PascalCase",
});
}
if (identifier[0] == 'I')
{
results.Add(new Detail
{
level = Level.Warning,
line = lineNumber,
codeSnippet = identifier.Trim(),
suggestion = CheckerUtils.ConvertPascalCase("I" + identifier),
guideline = "在interface名称前加上字母I来表示type是interface。(如ICinfig)",
});
}
if (identifier[0] == '_')
{
results.Add(new Detail
{
level = Level.Error,
line = lineNumber,
codeSnippet = identifier.Trim(),
suggestion = CheckerUtils.ConvertPascalCase(identifier.Substring(1)),
guideline = "接口名禁用以下划线开始",
});
}
}
var filename = Path.GetFileNameWithoutExtension(filepath);
if (interfaceDecs.Count > 0 && interfaceDecs.All(x => x.Identifier.ValueText != filename))
{
results.Add(new Detail
{
level = Level.Warning,
guideline = "文件名应和类名相同",
});
}
return results;
}
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: dce22fd599b943c58611ed31371778a6
timeCreated: 1627456321

View File

@@ -1,38 +0,0 @@
using System.Collections.Generic;
using System.Linq;
using Microsoft.CodeAnalysis.CSharp.Syntax;
namespace wvdet.CodeChecker
{
public class CheckNamespace : ICheckable
{
private static List<string> Forbiddens = new List<string>()
{
//针对于禁用的命名空间放在此处
// "System.Linq",
};
public List<Detail> Check(string filepath, CompilationUnitSyntax root)
{
var results = new List<Detail>();
var usings = root.DescendantNodes().OfType<UsingDirectiveSyntax>();
foreach (var us in usings)
{
var ns = us.Name.ToString();
if (Forbiddens.Contains(ns))
{
results.Add(new Detail
{
level = Level.Error,
line = us.GetLocation().GetLineSpan().StartLinePosition.Line + 1,
guideline = $"禁用此命名空间:{ns}",
});
}
}
return results;
}
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 8779cc1ce7674a8da69644ca6f980f1e
timeCreated: 1638409766

View File

@@ -1,82 +0,0 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.CodeAnalysis.CSharp.Syntax;
namespace wvdet.CodeChecker
{
/// <summary>
/// Struct [结构体] 命名规范
/// 使用 Pascal Case。
/// 使用名词或者名词性词组命名接口。
/// 不要轻易使用缩写。
/// 在struct 名称前加上字母S来表示type是在struct。(如SData)
/// 不使用下划线。
/// 文件名应和类名相同。
/// </summary>
public class CheckStruct : ICheckable
{
public List<Detail> Check(string filepath, CompilationUnitSyntax root)
{
var results = new List<Detail>();
var interfaceDecs = root.DescendantNodes().OfType<StructDeclarationSyntax>().ToList();
foreach (var dec in interfaceDecs)
{
var identifier = dec.Identifier.ValueText;
var lineNumber = dec.GetLocation().GetLineSpan().StartLinePosition.Line;
if (CheckerUtils.IsChineseIdentifier(identifier, lineNumber, out var ret))
results.Add(ret);
if (!char.IsLower(identifier[0]))
{
results.Add(new Detail
{
level = Level.Error,
line = lineNumber,
codeSnippet = identifier.Trim(),
suggestion = CheckerUtils.ConvertPascalCase("S" + identifier),
guideline = "结构体类型名必须使用PascalCase",
});
}
else if (identifier[0] != 'S')
{
results.Add(new Detail
{
level = Level.Warning,
line = lineNumber,
codeSnippet = identifier.Trim(),
suggestion = CheckerUtils.ConvertPascalCase("S" + identifier),
guideline = "在struct名称前加上字母S来表示type是struct。(如SData)",
});
}
else if (identifier[0] == '_')
{
results.Add(new Detail
{
level = Level.Error,
line = lineNumber,
codeSnippet = identifier.Trim(),
suggestion = CheckerUtils.ConvertPascalCase("S" + identifier.Substring(1)),
guideline = "结构体名禁用以下划线开始",
});
}
}
var filename = Path.GetFileNameWithoutExtension(filepath);
if (interfaceDecs.Count > 0 && interfaceDecs.All(x => x.Identifier.ValueText != filename))
{
results.Add(new Detail
{
level = Level.Warning,
guideline = "文件名应和类名相同",
});
}
return results;
}
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 569ca7d7c88102e4b81629916b323157
timeCreated: 1627456321

View File

@@ -1,10 +0,0 @@
using System.Collections.Generic;
using Microsoft.CodeAnalysis.CSharp.Syntax;
namespace wvdet.CodeChecker
{
public interface ICheckable
{
List<Detail> Check(string filepath, CompilationUnitSyntax root);
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 6fff035c37d84e09a40da28d1b2fd4ed
timeCreated: 1638409121

View File

@@ -1,29 +0,0 @@
using System.Collections.Generic;
namespace wvdet.CodeChecker
{
public enum Level
{
Hint,
Warning,
Error,
}
public class Result
{
public string filepath;
public int warningCount;
public int errorCount;
public List<Detail> details = new List<Detail>();
}
public class Detail
{
public int line = -1;
public Level level;
public string suggestion;
public string guideline;
public string codeSnippet;
}
}

View File

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

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: d68ee2e51faf9a949814bbfcb7318f55
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,201 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: bdf59ece5232d134d888d8e6b8f83f62
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,76 +0,0 @@
fileFormatVersion: 2
guid: 642cc7a82951220419618e4c8e397c47
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Android: Android
second:
enabled: 0
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,76 +0,0 @@
fileFormatVersion: 2
guid: 3c5c51ca2f8d35e41841f3922a8fbd1b
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Android: Android
second:
enabled: 0
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,68 +0,0 @@
fileFormatVersion: 2
guid: 2dda9533799322545a80fc398594fe8f
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,68 +0,0 @@
fileFormatVersion: 2
guid: ed7d8feb5dde1b44790434d33db912f2
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,68 +0,0 @@
fileFormatVersion: 2
guid: b9c8d83ed598cbc48875adecd7a41cde
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,68 +0,0 @@
fileFormatVersion: 2
guid: 1d3abae191829e64f9a924f34d1c0223
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,68 +0,0 @@
fileFormatVersion: 2
guid: 65eddef11133357479cd20637e5a6c18
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,68 +0,0 @@
fileFormatVersion: 2
guid: 78e5655a00394af45854082b489beb6d
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,68 +0,0 @@
fileFormatVersion: 2
guid: dbb4543e5bdf6014f9c09a941b644816
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,15 +0,0 @@
# .NET Compiler Platform ("Roslyn") For Unity
This project aims to create a compiled version of the [Roslyn compiler platform](https://github.com/dotnet/roslyn) ready to use in the [Unity Game Engine](https://unity.com/). The Roslyn library provides users APIs to access C# and Visual Basic compilers and code analysis features. In Unity, this is particularly useful for creating in-game scripting tools.
The following Roslyn packages are currently available through this project:
* Microsoft.Net.Compilers
* Microsoft.CodeAnalysis
* Microsoft.CodeAnalysis.Features
## Using this project
To use this project, download the Unity package from the [releases page.](https://github.com/mwahnish/Unity-Roslyn/releases). Compatibility has been tested for the following platforms:
* Unity 2018.1 Editor
* Unity 2019.1 Editor
## Contributing to this project
The build project for this repository is available [here](https://github.com/mwahnish/Unity-Roslyn-Build). See the readme for more information. Merge requests are very welcome!

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 095275ac5025dc644b84a5bc96be400b
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: f2bf18fc5ba02dd4996477b645d936e2
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,68 +0,0 @@
fileFormatVersion: 2
guid: be224bdfba1970a41ab1a42f9bdd6327
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,68 +0,0 @@
fileFormatVersion: 2
guid: 5abcf4c62eabf6a45af25d5a4565fdd7
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,68 +0,0 @@
fileFormatVersion: 2
guid: fa72f5f7e968d2f4c90f7eb11bbb1821
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,68 +0,0 @@
fileFormatVersion: 2
guid: 01fb60a9c1a4bfc40a2c5d853b309e44
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,68 +0,0 @@
fileFormatVersion: 2
guid: 29c7af3d7dde9c7498fd7774976e131d
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,68 +0,0 @@
fileFormatVersion: 2
guid: fe2fd417bb00a19448503cef7ee2a2ac
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,68 +0,0 @@
fileFormatVersion: 2
guid: 8306fde914b256d45bc96c4ebe51d925
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,68 +0,0 @@
fileFormatVersion: 2
guid: 424cd100e08e003489b5737589e2e513
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,68 +0,0 @@
fileFormatVersion: 2
guid: 611ffa0f37995b8438f1d4b19745a6df
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,68 +0,0 @@
fileFormatVersion: 2
guid: ee160a2b0bc909d48974ef375c9726ac
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,68 +0,0 @@
fileFormatVersion: 2
guid: f165326941efc0f4d98bd29f26418114
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,68 +0,0 @@
fileFormatVersion: 2
guid: 1253673c16d01a94e9019de31aecf5d6
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,68 +0,0 @@
fileFormatVersion: 2
guid: b0a94c22d12871948801586721088c13
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,68 +0,0 @@
fileFormatVersion: 2
guid: cdcc4e599c87c9c4f8cc64b6ecd72f10
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,68 +0,0 @@
fileFormatVersion: 2
guid: 2ca779980d9733349b3dd2ac8f11000b
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,68 +0,0 @@
fileFormatVersion: 2
guid: 17c14e4ca83bae249af816107e51adeb
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,68 +0,0 @@
fileFormatVersion: 2
guid: 3882831d0b3b05642b36c9c161a13f8a
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,68 +0,0 @@
fileFormatVersion: 2
guid: fef21a57eef716b4c86e58c9b5976e5d
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,13 +0,0 @@
{
"name": "com.abxy.roslyn",
"displayName": "\".NET Compiler Platform (\"Roslyn\")\"",
"version": "0.0.1",
"unity": "2018.1",
"description": "The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs",
"keywords": [
"csharp",
"roslyn",
"compiler"
],
"category": "Coding Tools"
}

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 0aa95ea4c96af104689a30269b0dabc9
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,16 +0,0 @@
{
"name": "com.staryEvo.codechecker",
"rootNamespace": "",
"references": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 679b09830dc7ef143b7a8ce5a8c54393
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1 +0,0 @@
# 代码检查工具

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 6940ef41dfd0fe945bcf41ccb2af9a73
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 57fe04c5339b10046abe20069fc3c2ee
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,16 +0,0 @@
{
"name": "com.staryevo.codechecker",
"version": "1.0.0",
"displayName": "01.CodeChecker",
"description": "代码检查工具",
"unity": "2021.3",
"unityRelease": "30f1",
"keywords": [
"unity",
"scirpt"
],
"author": {
"name": "staryEvo",
"url": "https://www.unity3d.com"
}
}

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 43559baaae073fc45a9b7a4554c22cfc
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: dc0c6a9a74c33bb45b7529d86d820e2e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: a832a8c4833f01744bb484de1af54c37
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,27 +0,0 @@
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
namespace Stary.Evo.InformationSave
{
[CustomEditor(typeof(CustomEditorBase), true)]
public class CustomEditorBaseEditor : UnityEditor.Editor
{
private CustomEditorBase _customEditorBase;
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
serializedObject.Update();
_customEditorBase = target as CustomEditorBase;
_customEditorBase.Draw();
//这个函数告诉引擎相关对象所属于的Prefab已经发生了更改。方便当我们更改了自定义对象的属性的时候自动更新到所属的Prefab中
if (GUI.changed && EditorApplication.isPlaying == false)
{
serializedObject.ApplyModifiedProperties();
EditorUtility.SetDirty(_customEditorBase);
EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
}
}
}
}

View File

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

View File

@@ -1 +0,0 @@
# 代码检查工具

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 9bf258ec9987c7c429bdcab7a16539fa
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: dd58efb7f9e1b0c4f9d07e84827f357d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 3e0efc3ec4ae1fe458358558357e78fb
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,225 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using Stary.Evo.InformationSave.Data;
using Newtonsoft.Json;
using UnityEditor;
using UnityEngine;
using System.Linq;
namespace Stary.Evo.InformationSave
{
public abstract class AbstractInformation<T> : CustomEditorBase where T : InformationBase, new()
{
[HideInInspector] public List<T> _list = new List<T>();
/// <summary>
/// 配置文件存储路径
/// </summary>
string path = "InformationSaveData/ScriptObjectSaveData";
public virtual void Add()
{
_list.Add(new T());
Save(_list.Count - 1);
}
public abstract void Save(int index);
public abstract void Switch(int index);
public virtual T GetTransform(string desc)
{
int index = _list.FindIndex(n => n.desc == desc);
if (index != -1)
{
return _list[index];
}
else
{
Debug.LogError($"{typeof(T)}:不存在该信息:" + desc);
return default(T);
}
}
public virtual void Delete(int index)
{
_list.RemoveAt(index);
}
public virtual void Set(string desc)
{
int index = _list.FindIndex(n => n.desc == desc);
if (index != -1) Switch(index);
}
#region Editor
#if UNITY_EDITOR
//更新
public void UpdateInformation()
{
String sceneNmae = gameObject.scene.name;
ScriptObjectSave scriptObjectSaveData = Resources.Load<ScriptObjectSave>(path);
if (scriptObjectSaveData == null)
{
Debug.LogError("ScriptObjectSaveData配置文件丢失");
return;
}
if (scriptObjectSaveData.dic.ContainsKey(sceneNmae + gameObject.name))
{
_list.Clear();
_list = scriptObjectSaveData.dic[sceneNmae + gameObject.name].OfType<T>().ToList();
}
else
{
Debug.LogError("ScriptObjectSaveData中未存储场景"+ sceneNmae + " 中物体:" + gameObject.name + "的数据!!!");
}
}
//动态保存
public bool PlayingSave()
{
//文件保存
if (Application.isEditor)
{
String sceneNmae = gameObject.scene.name;
// 加载 ScriptObjectSaveData
ScriptObjectSave scriptObjectSaveData = Resources.Load<ScriptObjectSave>(path);
if(scriptObjectSaveData == null)
{
scriptObjectSaveData = CheckAndCreateFoldersAndAsset();
Debug.Log("创建了ScriptObjectSaveData文件");
}
if (scriptObjectSaveData.dic == null)
{
Debug.LogError("ScriptObjectSaveData的dic为空");
return false;
}
// 检查是否已经存在相同的键
if (scriptObjectSaveData.dic.ContainsKey(sceneNmae + gameObject.name))
{
// 如果存在,选择是否替换原有的 List
if (UnityEditor.EditorUtility.DisplayDialog("提示", "数据集下已有相同名称的物体数据\n是否覆盖更新\n" + "场景名:" + sceneNmae + "\n物体名" + gameObject.name, "确定", "取消"))
{
scriptObjectSaveData.dic[sceneNmae + gameObject.name] = new List<InformationBase>(_list);
}
else
{
return false;
}
}
else
{
// 如果不存在,添加新的键值对
scriptObjectSaveData.dic.Add(sceneNmae + gameObject.name, new List<InformationBase>(_list));
}
AssetDatabase.SaveAssets();
AssetDatabase.Refresh();
return true;
}
return false;
}
private ScriptObjectSave CheckAndCreateFoldersAndAsset()
{
string ResourcesFolderName = "Resources";
string InformationSaveDataFolderName = "InformationSaveData";
string ScriptObjectSaveDataFileName = "ScriptObjectSaveData";
ScriptObjectSave scriptableObject;
// 判断是否创建Resources文件夹
string resourcesPath = Path.Combine(Application.dataPath, ResourcesFolderName);
if (!Directory.Exists(resourcesPath))
{
Directory.CreateDirectory(resourcesPath);
}
// 判断是否创建InformationSaveData文件夹
string informationSaveDataPath = Path.Combine(resourcesPath, InformationSaveDataFolderName);
if (!Directory.Exists(informationSaveDataPath))
{
Directory.CreateDirectory(informationSaveDataPath);
}
// 创建ScriptObjectSaveData.asset文件
scriptableObject = ScriptableObject.CreateInstance<ScriptObjectSave>();
AssetDatabase.CreateAsset(scriptableObject, "Assets/" + ResourcesFolderName + "/" + InformationSaveDataFolderName + "/" + ScriptObjectSaveDataFileName + ".asset");
AssetDatabase.SaveAssets();
AssetDatabase.Refresh();
return scriptableObject;
}
//绘制
public override void Draw()
{
int length = _list.Count;
int deleteIndex = -1;
for (int i = 0; i < length; i++)
{
GUILayout.BeginHorizontal();
_list[i].desc = UnityEditor.EditorGUILayout.TextField(_list[i].desc);
if (GUILayout.Button("切换")) Switch(i);
if (GUILayout.Button("保存"))
{
Save(i);
if (PlayingSave()) Debug.Log("保存成功!");
}
if (GUILayout.Button("上移") && i > 0)
{
T temp = _list[i - 1];
_list[i - 1] = _list[i];
_list[i] = temp;
}
if (GUILayout.Button("下移") && i < _list.Count - 1)
{
T temp = _list[i + 1];
_list[i + 1] = _list[i];
_list[i] = temp;
}
if (GUILayout.Button("删除") && UnityEditor.EditorUtility.DisplayDialog("警告", "你确定要删除吗?", "确定", "取消"))
deleteIndex = i;
GUILayout.EndHorizontal();
if (i != length - 1) GUILayout.Space(20);
}
if (deleteIndex != -1) Delete(deleteIndex);
GUILayout.Space(30);
GUILayout.BeginHorizontal();
if (GUILayout.Button("添加"))
{
Add();
}
if (GUILayout.Button("更新") && UnityEditor.EditorUtility.DisplayDialog("提示", "你确定要更新吗?", "确定", "取消"))
{
UpdateInformation();
GUILayout.BeginHorizontal();
}
GUILayout.EndHorizontal();
}
#else
public override void Draw(){}
#endif
}
#endregion
[System.Serializable]
public class InformationBase
{
public string desc = "初始";
}
}

Some files were not shown because too many files have changed in this diff Show More