381 lines
11 KiB
C#
381 lines
11 KiB
C#
using CaoCao.Runtime;
|
||
using CaoCao.XAsset;
|
||
using UnityEngine;
|
||
|
||
namespace Game.HotFix
|
||
{
|
||
public static class HotfixEntry
|
||
{
|
||
public static ResourcesComponent Resources
|
||
{
|
||
get;
|
||
private set;
|
||
}
|
||
|
||
//public static MouseComponent Mouse
|
||
//{
|
||
// get;
|
||
// private set;
|
||
//}
|
||
|
||
public static MainPlayerComponent MainPlayer
|
||
{
|
||
get;
|
||
private set;
|
||
}
|
||
|
||
//public static MapComponent Map
|
||
//{
|
||
// get;
|
||
// private set;
|
||
//}
|
||
|
||
//public static UserMgrComponent UserMgr
|
||
//{
|
||
// get;
|
||
// private set;
|
||
//}
|
||
|
||
public static LubanComponent Luban
|
||
{
|
||
get;
|
||
set;
|
||
}
|
||
|
||
//public static RobotMgrComponent RobotMgr
|
||
//{
|
||
// get;
|
||
// set;
|
||
//}
|
||
//public static NPCMgrComponent NpcMgr
|
||
//{
|
||
// get;
|
||
// set;
|
||
//}
|
||
|
||
//public static InputComponent Input
|
||
//{
|
||
// get;
|
||
// set;
|
||
//}
|
||
|
||
//public static NetworkComponent Network
|
||
//{
|
||
// get;
|
||
// set;
|
||
//}
|
||
|
||
//public static DropMgrComponent DropMgr
|
||
//{
|
||
// get;
|
||
// set;
|
||
//}
|
||
|
||
//public static ItemMgrComponent ItemMgr
|
||
//{
|
||
// get;
|
||
// set;
|
||
//}
|
||
|
||
//public static EffectMgrComponent EffectMgr
|
||
//{
|
||
// get;
|
||
// set;
|
||
//}
|
||
|
||
|
||
//public static EquipMgrComponent EquipMgr
|
||
//{
|
||
// get;
|
||
// set;
|
||
//}
|
||
|
||
public static UIMgr UI
|
||
{
|
||
get;
|
||
private set;
|
||
}
|
||
|
||
|
||
//public static UICrossPlatform UICP { get; set; }
|
||
|
||
|
||
public static Tips Tips
|
||
{
|
||
get;
|
||
private set;
|
||
}
|
||
|
||
//public static ChatComponent Chat
|
||
//{
|
||
// get;
|
||
// private set;
|
||
//}
|
||
//public static TaskComponent Task
|
||
//{
|
||
// get;
|
||
// private set;
|
||
//}
|
||
//public static StandingComponent Standing
|
||
//{
|
||
// get;
|
||
// private set;
|
||
//}
|
||
//public static NoviceComponent Novice
|
||
//{
|
||
// get;
|
||
// private set;
|
||
//}
|
||
|
||
//public static FindWayComponent FindWay
|
||
//{
|
||
// get;
|
||
// set;
|
||
//}
|
||
|
||
//public static AutoGameComponent AutoGame
|
||
//{
|
||
// get;
|
||
// set;
|
||
//}
|
||
//public static ClanMgr mClan
|
||
//{
|
||
// get;
|
||
// set;
|
||
//}
|
||
|
||
//public static AudioComponent Audio
|
||
//{
|
||
// get;
|
||
// private set;
|
||
//}
|
||
|
||
//public static TimeManager TimeMgr
|
||
//{
|
||
// get { return TimeManager.Instance; }
|
||
//}
|
||
|
||
//public static SocialMgr mSocialMgr
|
||
//{
|
||
// get;
|
||
// set;
|
||
|
||
//}
|
||
|
||
//public static TeamMgr mTeamMgr
|
||
//{
|
||
// get;set;
|
||
//}
|
||
|
||
//private static GuajiMgr mGuaji;
|
||
//public static GuajiMgr Guaji
|
||
//{
|
||
// get
|
||
// {
|
||
// if (mGuaji == null)
|
||
// mGuaji = new GuajiMgr();
|
||
|
||
// return mGuaji;
|
||
|
||
// }
|
||
//}
|
||
|
||
|
||
//public static SkillComponent Skill { get; set; }
|
||
|
||
//public static SubpackageMgrComponent SubpackageMgr;
|
||
|
||
|
||
//public static BadWordFilter mBadWords { get; set; }
|
||
|
||
////public static ActivityMgr mActivity;
|
||
//public static ActivityMgr Activity
|
||
//{
|
||
// get;
|
||
// private set;
|
||
//}
|
||
|
||
//public static NotifyComponent Notify
|
||
//{
|
||
// get;
|
||
// private set;
|
||
//}
|
||
|
||
|
||
//public static GameSetting mGameSetting { get; set; }
|
||
|
||
//public static RankComponent mRankComponent { get; set; }
|
||
|
||
//public static ShopComponent mShopComponent { get; set; }
|
||
|
||
//public static RedbagComponent RedBag { get; set; }
|
||
|
||
//public static PokemonMgrComponent PokemonMgr { get; set; }
|
||
//public static QQGameMgrComponent QQGameMgr { get; set; }
|
||
|
||
//public static PetMgr mPetMgr { get; set; }
|
||
|
||
//public static LocalStorage LocalStorage { get; set; }
|
||
|
||
//public static bool IsPC = false;
|
||
|
||
|
||
// Start is called before the first frame update
|
||
public static void Init()
|
||
{
|
||
// //PC <20><>ֹ<EFBFBD>ر<EFBFBD>
|
||
//#if UNITY_STANDALONE_WIN && !UNITY_EDITOR_WIN
|
||
// Application.wantsToQuit += ChangeByPassClose;
|
||
//#endif
|
||
|
||
//#if UNITY_STANDALONE_WIN && !UNITY_EDITOR
|
||
// IsPC = true;
|
||
// GameObject.Find("Debugger")?.SetActive(false);
|
||
//#endif
|
||
|
||
//<2F>༭<EFBFBD><E0BCAD><EFBFBD><EFBFBD><EFBFBD>ԣ<EFBFBD><D4A3><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD>ʹ<EFBFBD><CDB4>룬ǿ<EBA3AC>Ƹ<EFBFBD>pc<70><63><EFBFBD><EFBFBD>ʶ
|
||
//#if UNITY_EDITOR
|
||
// IsPC = UICrossPlatform.bMustPCTest;
|
||
//#endif
|
||
|
||
|
||
////<2F><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
//if (
|
||
// AppEntry.GetPackageID() == 20010001//PC<50><43>
|
||
// )
|
||
//{
|
||
// ConstClass.gameStyleVersion = GameStyleVersion.Green;
|
||
//}
|
||
//else
|
||
//{
|
||
// //<2F><><EFBFBD><EFBFBD>ɫ<EFBFBD><C9AB>
|
||
// ConstClass.gameStyleVersion = GameStyleVersion.Common;
|
||
//}
|
||
|
||
//#if UNITY_EDITOR
|
||
// ConstClass.gameStyleVersion = GameStyleVersion.Green;
|
||
//#endif
|
||
//mGameSetting = new GameSetting();
|
||
|
||
|
||
//<2F><><EFBFBD><EFBFBD>ȡһ<C8A1><D2BB>CaoCao/Customs<6D>µĽڵ<C4BD>
|
||
Transform parent = AppEntry.BuiltinData.transform.parent;
|
||
|
||
Resources = parent.Find("Resources").gameObject.AddComponent<ResourcesComponent>();
|
||
// Mouse = parent.Find("Logic").gameObject.AddComponent<MouseComponent>();
|
||
// Input = parent.Find("Input").gameObject.AddComponent<InputComponent>();
|
||
// Map = parent.Find("Map").gameObject.AddComponent<MapComponent>();
|
||
// MainPlayer = parent.Find("MainPlayer").gameObject.AddComponent<MainPlayerComponent>();
|
||
Luban = parent.Find("Luban").gameObject.AddComponent<LubanComponent>();
|
||
// UserMgr = parent.Find("UserMgr").gameObject.AddComponent<UserMgrComponent>();
|
||
// RobotMgr = parent.Find("RobotMgr").gameObject.AddComponent<RobotMgrComponent>();
|
||
// NpcMgr = parent.Find("NPCMgr").gameObject.AddComponent<NPCMgrComponent>();
|
||
// Network = parent.Find("Network").gameObject.AddComponent<NetworkComponent>();
|
||
// DropMgr = parent.Find("DropMgr").gameObject.AddComponent<DropMgrComponent>();
|
||
// EffectMgr = parent.Find("EffectMgr").gameObject.AddComponent<EffectMgrComponent>();
|
||
Tips = parent.Find("Tips").gameObject.AddComponent<Tips>();
|
||
// Chat = parent.Find("Logic").gameObject.AddComponent<ChatComponent>();
|
||
// Task = parent.Find("Logic").gameObject.AddComponent<TaskComponent>();
|
||
// Standing = parent.Find("Logic").gameObject.AddComponent<StandingComponent>();
|
||
// Novice = parent.Find("Logic").gameObject.AddComponent<NoviceComponent>();
|
||
// FindWay = parent.Find("Logic").gameObject.AddComponent<FindWayComponent>();
|
||
// AutoGame = parent.Find("Logic").gameObject.AddComponent<AutoGameComponent>();
|
||
// mClan = parent.Find("Logic").gameObject.AddComponent<ClanMgr>();
|
||
// EquipMgr = parent.Find("Logic").gameObject.AddComponent<EquipMgrComponent>();
|
||
// Audio = parent.Find("Audio").gameObject.AddComponent<AudioComponent>();
|
||
// mSocialMgr = parent.Find("Logic").gameObject.AddComponent<SocialMgr>();
|
||
|
||
// mTeamMgr = parent.Find("Logic").gameObject.AddComponent<TeamMgr>();
|
||
// SubpackageMgr = parent.Find("SubpackageMgr").gameObject.AddComponent<SubpackageMgrComponent>();
|
||
// Skill = parent.Find("Logic").gameObject.AddComponent<SkillComponent>();
|
||
// Activity = parent.Find("Logic").gameObject.AddComponent<ActivityMgr>();
|
||
// Notify = parent.Find("Logic").gameObject.AddComponent<NotifyComponent>();
|
||
// mPetMgr = parent.Find("Logic").gameObject.AddComponent<PetMgr>();
|
||
// mRankComponent = parent.Find("Logic").gameObject.AddComponent<RankComponent>();
|
||
// mShopComponent = parent.Find("Logic").gameObject.AddComponent<ShopComponent>();
|
||
// RedBag = parent.Find("Logic").gameObject.AddComponent<RedbagComponent>();
|
||
|
||
// if (AppEntry.GetPackageID() == 10071001)//<2F><>QQ<51><51><EFBFBD><EFBFBD> <20><><EFBFBD>ڱ<EFBFBD><DAB1>ű<EFBFBD>
|
||
// {
|
||
// QQGameMgr = parent.Find("Logic").gameObject.AddComponent<QQGameMgrComponent>();
|
||
// }
|
||
|
||
// GameObject pokemonNode = new GameObject();
|
||
// pokemonNode.name = "Pokemon";
|
||
//pokemonNode.transform.parent = parent;
|
||
// pokemonNode.transform.localPosition = Vector3.zero;
|
||
//PokemonMgr = pokemonNode.gameObject.AddComponent<PokemonMgrComponent>();
|
||
|
||
// LocalStorage = LocalStorage.Instance;
|
||
|
||
// mBadWords = BadWordFilter.GetInstance();
|
||
|
||
|
||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD>
|
||
Luban.Init();
|
||
|
||
GameObject go = Resources.Clone("Assets/GameAssets/Prefabs/UI/UIControl/UIMgr.prefab", parent);
|
||
if (go == null)
|
||
return;
|
||
go.GetComponent<Transform>().localScale = Vector3.one;
|
||
|
||
UI = go.GetComponent<UIMgr>();
|
||
//UICP = go.AddComponent<UICrossPlatform>();
|
||
}
|
||
|
||
|
||
|
||
|
||
#region
|
||
|
||
|
||
|
||
// static public void SetGameScreen()
|
||
// {
|
||
//#if UNITY_EDITOR
|
||
// return;
|
||
//#endif
|
||
// if (HotfixEntry.IsPC && UICrossPlatform.IsNewPlan)
|
||
// {
|
||
// Common.GetPC_ScreenSetting(out Vector2 size, out bool bFull);
|
||
// Screen.SetResolution((int)size.x, (int)size.y, bFull);
|
||
// HotfixEntry.Input.ReSetTerrainCanvas();
|
||
// }
|
||
// }
|
||
|
||
//static public void SetGameInputMode()
|
||
//{
|
||
// int Mode = HotfixEntry.mGameSetting._pcSkillSetting.Mode;
|
||
// if (!HotfixEntry.IsPC)
|
||
// return;
|
||
|
||
// if (Mode == 0)
|
||
// {
|
||
// HotfixEntry.Tips.ShowHint("<22>л<EFBFBD>Ϊ:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||
// if (HotfixEntry.UI.IsOpen<PC_ModeBHubUI>())
|
||
// HotfixEntry.UI.CloseUI<PC_ModeBHubUI>();
|
||
// }
|
||
// else
|
||
// {
|
||
// HotfixEntry.Tips.ShowHint("<22>л<EFBFBD>Ϊ:<3A>°<EFBFBD><C2B0><EFBFBD><EFBFBD><EFBFBD>");
|
||
// if (!HotfixEntry.UI.IsOpen<PC_ModeBHubUI>())
|
||
// HotfixEntry.UI.OpenUI<PC_ModeBHubUI>(eUINodeType.NodeScreen);
|
||
// }
|
||
// AppEntry.Event.FireNow(null, InputMouseToMoveEventArgs.Create());
|
||
//}
|
||
|
||
#endregion
|
||
|
||
static bool ChangeByPassClose()
|
||
{
|
||
HotfixEntry.Tips.ShowChoice($"<22>Ƿ<EFBFBD><C7B7>ر<EFBFBD><D8B1><EFBFBD>Ϸ<EFBFBD><CFB7>", () =>
|
||
{
|
||
Application.wantsToQuit -= ChangeByPassClose;
|
||
Application.Quit();
|
||
});
|
||
return false;
|
||
}
|
||
}
|
||
|
||
}
|