split runtime and editor

This commit is contained in:
max
2022-12-28 13:55:36 +01:00
parent b9472d59b4
commit a0fa2c9b36
36 changed files with 43 additions and 7 deletions

View File

@ -0,0 +1,14 @@
 using System;
using System.Linq;
public static class SerializeReferenceTypeRestrictionFilters
{
public static Func<Type, bool> TypeIsNotSubclassOrEqualOrHasInterface(Type[] types) => type =>
TypeIsSubclassOrEqualOrHasInterface(types).Invoke(type) == false;
public static Func<Type, bool> TypeIsSubclassOrEqualOrHasInterface(Type[] types) => type =>
types.Any(e => e.IsInterface ? TypeHasInterface(type, e) : TypeIsSubclassOrEqual(type, e));
public static bool TypeIsSubclassOrEqual(Type type, Type comparator) => type.IsSubclassOf(comparator) || type == comparator;
public static bool TypeHasInterface(this Type type, Type comparator) => type.GetInterface(comparator.ToString()) != null;
}

View File

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