static void RegisterComponentTypes()
        {
            TypeManager.Initialize();

            AssetDatabaseCompatibility.UnregisterCustomDependencyPrefixFilter("DOTSType/");
            int typeCount = TypeManager.GetTypeCount();

            for (int i = 1; i < typeCount; ++i)
            {
                ref readonly var typeInfo = ref TypeManager.GetTypeInfo(i);
        static void RegisterComponentTypes()
        {
            TypeManager.Initialize();

            AssetDatabaseCompatibility.UnregisterCustomDependencyPrefixFilter("DOTSType/");
            int typeCount = TypeManager.GetTypeCount();

            for (int i = 1; i < typeCount; ++i)
            {
                var typeInfo = TypeManager.GetTypeInfo(i);
                var hash     = typeInfo.StableTypeHash;
                AssetDatabaseCompatibility.RegisterCustomDependency(TypeString(typeInfo.Type),
                                                                    new UnityEngine.Hash128(hash, hash));
            }
        }
Example #3
0
        public static void RegisterMonoScripts()
        {
            if (AssetDatabaseCompatibility.IsAssetImportWorkerProcess() || s_Initialized)
            {
                return;
            }
            s_Initialized = true;

            AssetDatabaseCompatibility.UnregisterCustomDependencyPrefixFilter("UnityEngineType/");

            var behaviours = TypeCache.GetTypesDerivedFrom <UnityEngine.MonoBehaviour>();
            var scripts    = TypeCache.GetTypesDerivedFrom <UnityEngine.ScriptableObject>();

            for (int i = 0; i != behaviours.Count; i++)
            {
                var type = behaviours[i];
                if (type.IsGenericType)
                {
                    continue;
                }
                var hash = TypeHash.CalculateStableTypeHash(type);
                AssetDatabaseCompatibility.RegisterCustomDependency(TypeString(type),
                                                                    new UnityEngine.Hash128(hash, hash));
            }

            for (int i = 0; i != scripts.Count; i++)
            {
                var type = scripts[i];
                if (type.IsGenericType)
                {
                    continue;
                }
                var hash = TypeHash.CalculateStableTypeHash(type);
                AssetDatabaseCompatibility.RegisterCustomDependency(TypeString(type),
                                                                    new UnityEngine.Hash128(hash, hash));
            }
        }