【问题标题】:Is there way to read unity assets MonoBehaviour.txt file?有没有办法读取统一资产 MonoBehaviour.txt 文件?
【发布时间】:2019-09-13 14:56:09
【问题描述】:

我正在从统一资产包文件中提取统一资产, 但我找不到使用程序读取这些文件的方法。

MonoBehaviour Base
    UInt8 m_Enabled = 1
    PPtr<MonoScript> m_Script
        int m_FileID = 0
        SInt64 m_PathID = -6465759843790442317
    string m_Name = "QuestTbl"
    QuestTblData tableDataList
        Array Array
        int size = 2
            [0]
            QuestTblData data
                int group_id = 150001
                int quest_id = 0
                int quest_type = 1
                int local_id = 15000100
                string quest_start_day = "2019-01-14"
                string quest_end_day = "2019-01-21"
                int category = 10
                string condition_type = "DUNGEON_CLEAR"
                int condition_id = 0
                int condition_value = 5
                int reward_type = 1
                int reward_id = 110364
                int reward_count = 1
            [1]
            QuestTblData data
                int group_id = 150002
                int quest_id = 0
                int quest_type = 1
                int local_id = 15000200
                string quest_start_day = "2019-01-14"
                string quest_end_day = "2019-01-21"
                int category = 10
                string condition_type = "DUNGEON_CLEAR"
                int condition_id = 0
                int condition_value = 10
                int reward_type = 1
                int reward_id = 110364
                int reward_count = 1

我怎样才能读取这个文件并转换成某个类? 任何语言都可以。

【问题讨论】:

  • 你不能......这只是序列化的数据,所以没有办法知道这个类中有哪些私有字段、属性和方法......你所能看到的就是称为Base 并有两个序列化字段:string m_NameList&lt;QuestTblData&gt; tableDataList(或者可能是QuestTblData[] tableDataList)和两个带有它们的值的条目....不清楚你要做什么

标签: c# unity3d assets


【解决方案1】:

没有

脚本文件只能通过引用 (GUID) 在资产包中。编译的类代码必须存在于基础项目中,以便在反序列化资产时实际附加脚本,否则您最终会得到MissingScriptException

【讨论】:

    猜你喜欢
    • 2021-10-16
    • 1970-01-01
    • 1970-01-01
    • 2022-12-10
    • 2018-06-10
    • 2022-08-04
    • 2019-06-29
    • 2011-05-21
    • 1970-01-01
    相关资源
    最近更新 更多