薛之猫大王
17 hours ago da45ccae4c4b03fa50308b442a04ccfd3de160e0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//
// GameApp.cs
// Create:
//      2019-10-29
// Description:
//      客户端应用类,初始化插件使用。
// Author:
//      薛林强 <545626463@qq.com>
//
// Copyright (c) 2026 虚幻骑士科技
 
using UnityEngine;
using System.Collections;
using Skyunion;
using AppDomain = ILRuntime.Runtime.Enviorment.AppDomain;
using System;
using System.Reflection;
using Client;
 
public class ClientApp : GameApp
{
    public GameObject m_SceneObject;
 
    private void Awake()
    {
        if (m_SceneObject)
        {
            m_SceneObject.SetActive(false);
        }
    }
 
    // 添加客户端自己的插件
    protected override void OnAddPlugin()
    {
        mPluginManager.Registered(new CorePlugin());
        mPluginManager.Registered(new ClientPlugin());
        mPluginManager.Registered(new NativePlugin());
    }
 
    // 所有插件初始化调用
    protected override void OnInitialized()
    {
        if (CoreUtils.hotService.GetHotfixMode() == HotfixMode.ILRT)
        {
            AppDomain app = CoreUtils.hotService.GetAppdomain() as AppDomain;
            ILRTBind.ILRTBind.Init(app);
        }
        if (m_SceneObject)
        {
            m_SceneObject.SetActive(true);
        }
        LanguageUtils.SetLanguage(LanguageUtils.GetLanguage());
    }
 
    protected override void OnAfterInitialized()
    {
        CoreUtils.logService.Debug(string.Format("Current Hotfix Mode:{0}", CoreUtils.hotService.GetHotfixMode().ToString()), Color.green);
        CoreUtils.logService.Debug(string.Format("Current Data Mode:{0}", CoreUtils.dataService.GetDataMode().ToString()), Color.green);
    }
    protected override void OnApplicationQuit()
    {
        base.OnApplicationQuit();
        ClientUtils.ClearCore();
    }
}