protected override void OnPrefabInit()
    {
        instance = this;
        if (KPlayerPrefs.HasKey("TemperatureUnit"))
        {
            GameUtil.temperatureUnit = (GameUtil.TemperatureUnit)KPlayerPrefs.GetInt("TemperatureUnit");
        }
        if (KPlayerPrefs.HasKey("MassUnit"))
        {
            GameUtil.massUnit = (GameUtil.MassUnit)KPlayerPrefs.GetInt("MassUnit");
        }
        RecipeManager.DestroyInstance();
        RecipeManager.Get();
        AnimMaterial = AnimMaterialAsset;
        Prefabs      = new List <KPrefabID>(from x in PrefabAssets
                                            where (UnityEngine.Object)x != (UnityEngine.Object) null
                                            select x);
        PrefabsByTag.Clear();
        PrefabsByAdditionalTags.Clear();
        CountableTags.Clear();
        Sprites = new Dictionary <HashedString, Sprite>();
        foreach (Sprite spriteAsset in SpriteAssets)
        {
            if (!((UnityEngine.Object)spriteAsset == (UnityEngine.Object)null))
            {
                HashedString key = new HashedString(spriteAsset.name);
                Sprites.Add(key, spriteAsset);
            }
        }
        TintedSprites = (from x in TintedSpriteAssets
                         where x != null && (UnityEngine.Object)x.sprite != (UnityEngine.Object) null
                         select x).ToList();
        Materials = (from x in MaterialAssets
                     where (UnityEngine.Object)x != (UnityEngine.Object) null
                     select x).ToList();
        Textures = (from x in TextureAssets
                    where (UnityEngine.Object)x != (UnityEngine.Object) null
                    select x).ToList();
        TextureAtlases = (from x in TextureAtlasAssets
                          where (UnityEngine.Object)x != (UnityEngine.Object) null
                          select x).ToList();
        BlockTileDecorInfos = (from x in BlockTileDecorInfoAssets
                               where (UnityEngine.Object)x != (UnityEngine.Object) null
                               select x).ToList();
        Anims = (from x in AnimAssets
                 where (UnityEngine.Object)x != (UnityEngine.Object) null
                 select x).ToList();
        Anims.AddRange(ModLoadedKAnims);
        UIPrefabs = UIPrefabAssets;
        DebugFont = DebugFontAsset;
        AsyncLoadManager <IGlobalAsyncLoader> .Run();

        GameAudioSheets.Get().Initialize();
        SubstanceListHookup();
        BuildingDefs = new List <BuildingDef>();
        foreach (KPrefabID prefabAsset in PrefabAssets)
        {
            if (!((UnityEngine.Object)prefabAsset == (UnityEngine.Object)null))
            {
                AddPrefab(prefabAsset);
            }
        }
        AnimTable.Clear();
        foreach (KAnimFile anim in Anims)
        {
            if ((UnityEngine.Object)anim != (UnityEngine.Object)null)
            {
                HashedString key2 = anim.name;
                AnimTable[key2] = anim;
            }
        }
        CreatePrefabs();
    }