protected override ConfigTable ReadTable(ByteBuffer byteBuffer)
        {
            CfgAvatarTable table = new CfgAvatarTable();

            table.ReadByte(byteBuffer);
            return(table);
        }
Пример #2
0
        public IEnumerator AsyncLoadAssets()
        {
            // 加载UIRoot
            HotfixLog.Log("开始加载UIRoot");
            var uiRoot = WindowManager.Instance.CreateUIRoot <CanvasRoot>("UIPanel/UIRoot");

            yield return(uiRoot);

            // 加载窗口
            HotfixLog.Log("开始加载登录窗口");
            yield return(WindowManager.Instance.OpenWindow(typeof(UILogin), "UIPanel/UILogin"));

            // 加载模型
            HotfixLog.Log("开始加载模型");
            var handle = ResourceManager.Instance.LoadAssetAsync <GameObject>("Entity/Sphere");

            yield return(handle);

            var sphere = handle.InstantiateObject;

            sphere.transform.position   = Vector3.zero;
            sphere.transform.localScale = Vector3.one * 3f;
            HotfixLog.Log($"模型名字:{sphere.name}");

            // 加载配表
            HotfixLog.Log("开始加载配表");
            yield return(ConfigManager.Instance.LoadConfig(typeof(CfgAvatar), "Config/Avatar"));

            CfgAvatar      config = ConfigManager.Instance.GetConfig(typeof(CfgAvatar)) as CfgAvatar;
            CfgAvatarTable table  = config.GetTable(1001) as CfgAvatarTable;

            HotfixLog.Log($"表格数据:{table.HeadIcon}");
            HotfixLog.Log($"表格数据:{table.Model}");
        }