Files
BabyVideo/Assets/Scripts/Init.cs
2026-02-09 20:10:14 +08:00

40 lines
1.2 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using FairyGUI;
using NBC;
using NBF;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using UnityEngine;
public class Init : MonoBehaviour
{
private void Awake()
{
DontDestroyOnLoad(gameObject);
}
void Start()
{
JsonConvert.DefaultSettings = () => new JsonSerializerSettings
{
ContractResolver = new CamelCasePropertyNamesContractResolver()
};
UI.Inst.SetUILanguage<UILangeageConfig>();
UI.Inst.SetUITween<UITweenConfig>();
MainBinder.BindAll();
UIObjectFactory.SetLoaderExtension(typeof(XGLoader));
UIConst.UIPackRootUrl = UIDef.UIRoot;
UIConfig.verticalScrollBar = "ui://hxr7rc7pt33p1hb";
UIConfig.defaultFont = "AlibabaPuHuiTi-3-Medium";
UI.Inst.SetUILanguage<UILangeageConfig>();
GRoot.inst.SetContentScaleFactor(UIDef.DefaultScreen.Width, UIDef.DefaultScreen.Height,
UIContentScaler.ScreenMatchMode.MatchWidthOrHeight);
UIConfig.modalLayerColor = new Color(211 / 255f, 214 / 255f, 218 / 55f, 0.5f);
LoginPanel.Show();
}
}