private void Awake()
 {
     KAnimBatchManager.DestroyInstance();
     KAnimGroupFile.DestroyInstance();
     KGlobalAnimParser.DestroyInstance();
     KAnimBatchManager.CreateInstance();
     KGlobalAnimParser.CreateInstance();
     Global.Instance.modManager.Load(Content.Animation);
     KAnimGroupFile.GetGroupFile().LoadAll();
     KAnimBatchManager.Instance().CompleteInit();
 }
Exemplo n.º 2
0
    private void Awake()
    {
        KCrashReporter crash_reporter = GetComponent <KCrashReporter>();

        if (((UnityEngine.Object)crash_reporter != (UnityEngine.Object)null) & (SceneInitializerLoader.ReportDeferredError == null))
        {
            SceneInitializerLoader.ReportDeferredError = delegate(SceneInitializerLoader.DeferredError deferred_error)
            {
                crash_reporter.ShowDialog(deferred_error.msg, deferred_error.stack_trace);
            };
        }
        globalCanvas = GameObject.Find("Canvas");
        UnityEngine.Object.DontDestroyOnLoad(globalCanvas.gameObject);
        OutputSystemInfo();
        Debug.Assert((UnityEngine.Object)Instance == (UnityEngine.Object)null);
        Instance = this;
        Debug.Log("Initializing at " + System.DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss.fff"));
        Debug.Log("Save path: " + Util.RootFolder());
        if (forcedAtlasInitializationList != null)
        {
            SpriteAtlas[] array = forcedAtlasInitializationList;
            foreach (SpriteAtlas spriteAtlas in array)
            {
                int      spriteCount = spriteAtlas.spriteCount;
                Sprite[] array2      = new Sprite[spriteCount];
                spriteAtlas.GetSprites(array2);
                Sprite[] array3 = array2;
                foreach (Sprite sprite in array3)
                {
                    Texture2D texture = sprite.texture;
                    if ((UnityEngine.Object)texture != (UnityEngine.Object)null)
                    {
                        texture.filterMode = FilterMode.Bilinear;
                        texture.anisoLevel = 4;
                        texture.mipMapBias = 0f;
                    }
                }
            }
        }
        FileSystem.Initialize();
        Singleton <StateMachineUpdater> .CreateInstance();

        Singleton <StateMachineManager> .CreateInstance();

        Localization.RegisterForTranslation(typeof(UI));
        modManager = new KMod.Manager();
        modManager.Load(Content.DLL);
        modManager.Load(Content.Strings);
        KSerialization.Manager.Initialize();
        mInputManager = new GameInputManager(GenerateDefaultBindings());
        Audio.Get();
        KAnimBatchManager.CreateInstance();
        Singleton <SoundEventVolumeCache> .CreateInstance();

        mAnimEventManager = new AnimEventManager();
        Singleton <KBatchedAnimUpdater> .CreateInstance();

        DistributionPlatform.Initialize();
        Localization.Initialize(false);
        modManager.Load(Content.Translation);
        modManager.distribution_platforms.Add(new Local("Local", Label.DistributionPlatform.Local));
        modManager.distribution_platforms.Add(new Local("Dev", Label.DistributionPlatform.Dev));
        mainThread            = Thread.CurrentThread;
        KProfiler.main_thread = Thread.CurrentThread;
        RestoreLegacyMetricsSetting();
        if (DistributionPlatform.Initialized)
        {
            if (!KPrivacyPrefs.instance.disableDataCollection)
            {
                Debug.Log("Logged into " + DistributionPlatform.Inst.Name + " with ID:" + DistributionPlatform.Inst.LocalUser.Id + ", NAME:" + DistributionPlatform.Inst.LocalUser.Name);
                ThreadedHttps <KleiAccount> .Instance.AuthenticateUser(OnGetUserIdKey);
            }
        }
        else
        {
            Debug.LogWarning("Can't init " + DistributionPlatform.Inst.Name + " distribution platform...");
            OnGetUserIdKey();
        }
        modManager.Load(Content.LayerableFiles);
        GlobalResources.Instance();
    }