first commit
This commit is contained in:
40
Assets/Scripts/Init.cs
Normal file
40
Assets/Scripts/Init.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user