cherry pick some attributes to remove
This commit is contained in:
parent
fc6cd81260
commit
cf5f91d19f
@ -17,9 +17,9 @@ namespace Byway.PostProcessor
|
||||
private readonly string[] RemoveAttributesNames =
|
||||
{
|
||||
// Just information
|
||||
"System.Runtime.CompilerServices.CompilerGeneratedAttribute",
|
||||
"System.Runtime.CompilerServices.ExtensionAttribute",
|
||||
"System.ParamArrayAttribute",
|
||||
//"System.Runtime.CompilerServices.CompilerGeneratedAttribute", // This is used for IEnumerator
|
||||
//"System.Runtime.CompilerServices.ExtensionAttribute", // Extension Method
|
||||
//"System.ParamArrayAttribute", // params parameter
|
||||
"System.Reflection.DefaultMemberAttribute",
|
||||
"System.Diagnostics.DebuggerStepThroughAttribute",
|
||||
"System.Diagnostics.DebuggerHiddenAttribute",
|
||||
@ -33,13 +33,13 @@ namespace Byway.PostProcessor
|
||||
"System.Runtime.InteropServices.ComVisibleAttribute",
|
||||
"System.Runtime.ConstrainedExecution.ReliabilityContractAttribute",
|
||||
// Editor only
|
||||
//"UnityEngine.AddComponentMenu",
|
||||
//"UnityEditor.MenuItem",
|
||||
//"UnityEngine.ContextMenu",
|
||||
//"UnityEngine.ExecuteInEditMode",
|
||||
//"UnityEngine.HideInInspector",
|
||||
"UnityEngine.AddComponentMenu",
|
||||
"UnityEditor.MenuItem",
|
||||
"UnityEngine.ContextMenu",
|
||||
//"UnityEngine.ExecuteInEditMode", // For some code, it needs it
|
||||
//"UnityEngine.HideInInspector", // Some code use it to hide serialized fields
|
||||
"UnityEngine.TooltipAttribute",
|
||||
//"UnityEngine.DisallowMultipleComponent",
|
||||
"UnityEngine.DisallowMultipleComponent",
|
||||
"UnityEngine.Internal.ExcludeFromDocsAttribute",
|
||||
};
|
||||
|
||||
@ -87,22 +87,12 @@ namespace Byway.PostProcessor
|
||||
private bool RemoveAttributes(string ownerName, Collection<CustomAttribute> customAttributes)
|
||||
{
|
||||
bool wasProcessed = false;
|
||||
foreach (var attrName in RemoveAttributesNames)
|
||||
{
|
||||
var index = -1;
|
||||
for (var i = 0; i < customAttributes.Count; i++)
|
||||
{
|
||||
var attr = customAttributes[i];
|
||||
if (attr.Constructor != null && attr.Constructor.DeclaringType.FullName == attrName)
|
||||
{
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (index != -1)
|
||||
for (int i = customAttributes.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if (RemoveAttributesNames.Contains(customAttributes[i].AttributeType.FullName))
|
||||
{
|
||||
customAttributes.RemoveAt(index);
|
||||
customAttributes.RemoveAt(i);
|
||||
wasProcessed = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "com.bywaystudios.ilpostprocess",
|
||||
"displayName": "IL Post Process",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.2",
|
||||
"description": "Package containing code for IL Post Process"
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user