码迷,mamicode.com
首页 > 编程语言 > 详细

Unity3D资源管理架构

时间:2017-07-20 15:20:26      阅读:201      评论:0      收藏:0      [点我收藏+]

标签:执行   format   date   pat   tcl   ada   使用   log   基于   

在Unity3D引擎中,场景资源文件(.unity)是以2进制格式存储的。但同一时候它也有一种基于文本的表现格式。

可在Edit>Project Setting>Editor 中设置:
技术分享
1.使用binary2text.exe(win下文件夹:Editor\Data\Tools)可将.unity文件转换成.txt文件,仅仅需将.unity文件拖拽到binary2text.exe上就可以生成.txt。
技术分享
2.Bin2Text.unity为測试场景场景中仅仅有一个名为“sakyaer”的空物体;
技术分享
3.相应这样一个场景。它的文本格式使用YAML格式存储,信息表例如以下:

  • 当中ClassID是Unity3D中类的序列编号。如:GameObject类ClassID=1,具体类的ID參照官方站点http://docs.unity3d.com/Manual/ClassIDReference.html
  • ID项为随记分配给每个实例的唯一标识
  • 资源文件使用m_作为前缀
  • 当中m_GameObject (file 0 path 1163297905)表现transform对gameobject的从属关系
External References


ID: 1 (ClassID: 29) SceneSettings
    m_ObjectHideFlags 0 (unsigned int)
    m_PVSData  (vector)
        size 0 (int)

    m_PVSObjectsArray  (vector)
        size 0 (int)

    m_PVSPortalsArray  (vector)
        size 0 (int)

    m_OcclusionBakeSettings  (OcclusionBakeSettings)
        smallestOccluder 5 (float)
        smallestHole 0.25 (float)
        backfaceThreshold 100 (float)


ID: 2 (ClassID: 104) RenderSettings
    m_Fog 0 (bool)
    m_FogColor (0.5 0.5 0.5 1) (ColorRGBA)
    m_FogMode 3 (int)
    m_FogDensity 0.01 (float)
    m_LinearFogStart 0 (float)
    m_LinearFogEnd 300 (float)
    m_AmbientLight (0.2 0.2 0.2 1) (ColorRGBA)
    m_SkyboxMaterial (file 0 path 0) (PPtr<Material>)
    m_HaloStrength 0.5 (float)
    m_FlareStrength 1 (float)
    m_FlareFadeSpeed 3 (float)
    m_HaloTexture (file 0 path 0) (PPtr<Texture2D>)
    m_SpotCookie (file 0 path 0) (PPtr<Texture2D>)
    m_ObjectHideFlags 0 (unsigned int)


ID: 3 (ClassID: 127) LevelGameManager
    m_ObjectHideFlags 0 (unsigned int)


ID: 4 (ClassID: 157) LightmapSettings
    m_ObjectHideFlags 0 (unsigned int)
    m_LightProbes (file 0 path 0) (PPtr<LightProbes>)
    m_Lightmaps  (vector)
        size 0 (int)

    m_LightmapsMode 1 (int)
    m_BakedColorSpace 0 (int)
    m_UseDualLightmapsInForward 0 (bool)
    m_LightmapEditorSettings  (LightmapEditorSettings)
        m_Resolution 50 (float)
        m_LastUsedResolution 0 (float)
        m_TextureWidth 1024 (int)
        m_TextureHeight 1024 (int)
        m_BounceBoost 1 (float)
        m_BounceIntensity 1 (float)
        m_SkyLightColor (0.86 0.93 1 1) (ColorRGBA)
        m_SkyLightIntensity 0 (float)
        m_Quality 0 (int)
        m_Bounces 1 (int)
        m_FinalGatherRays 1000 (int)
        m_FinalGatherContrastThreshold 0.05 (float)
        m_FinalGatherGradientThreshold 0 (float)
        m_FinalGatherInterpolationPoints 15 (int)
        m_AOAmount 0 (float)
        m_AOMaxDistance 0.1 (float)
        m_AOContrast 1 (float)
        m_LODSurfaceMappingDistance 1 (float)
        m_Padding 0 (int)
        m_TextureCompression 0 (bool)
        m_LockAtlas 0 (bool)


ID: 5 (ClassID: 196) NavMeshSettings
    m_ObjectHideFlags 0 (unsigned int)
    m_BuildSettings  (NavMeshBuildSettings)
        agentRadius 0.5 (float)
        agentHeight 2 (float)
        agentSlope 45 (float)
        agentClimb 0.4 (float)
        ledgeDropHeight 0 (float)
        maxJumpAcrossDistance 0 (float)
        accuratePlacement 0 (bool)
        minRegionArea 2 (float)
        widthInaccuracy 16.6667 (float)
        heightInaccuracy 10 (float)
    m_NavMesh (file 0 path 0) (PPtr<NavMesh>)


ID: 1163297905 (ClassID: 1) GameObject
    m_ObjectHideFlags 0 (unsigned int)
    m_PrefabParentObject (file 0 path 0) (PPtr<EditorExtension>)
    m_PrefabInternal (file 0 path 0) (PPtr<Prefab>)
    m_Component  (vector)
        size 1 (int)
        data  (pair)
            first 4 (int)
            second (file 0 path 1163297906) (PPtr<Component>)

    m_Layer 0 (unsigned int)
    m_Name "Sakyaer" (string)
    m_TagString "Untagged" (string)
    m_Icon (file 0 path 0) (PPtr<Texture2D>)
    m_NavMeshLayer 0 (unsigned int)
    m_StaticEditorFlags 0 (unsigned int)
    m_IsActive 1 (bool)


ID: 1163297906 (ClassID: 4) Transform
    m_ObjectHideFlags 0 (unsigned int)
    m_PrefabParentObject (file 0 path 0) (PPtr<EditorExtension>)
    m_PrefabInternal (file 0 path 0) (PPtr<Prefab>)
    m_GameObject (file 0 path 1163297905) (PPtr<GameObject>)
    m_LocalRotation  (Quaternionf)
        x 0 (float)
        y 0 (float)
        z 0 (float)
        w 1 (float)
    m_LocalPosition (0 0 0) (Vector3f)
    m_LocalScale (1 1 1) (Vector3f)
    m_Children  (vector)
        size 0 (int)

    m_Father (file 0 path 0) (PPtr<Transform>)
    m_RootOrder 0 (int)

4.Unity3D中对于每个资源文件都会生成相应.meta文件,该文件能够用记事本直接打开;guid(全局唯一标识符,Globally Unique Identifier)是系统随机生成的对资源的标识符,guid在游戏执行时会被用来生成一个hashid。而依据guid的前两位0a能够在projectLibrary文件夹下metadate(元数据)0a文件夹下找到。相应的二进制文件,该文件能够使用binary2text.exe打开,得到的txt文件。记录了.meta文件相应资源的全部具体信息。

guid: 0a4a878577c88654795d8c6aee74368d

參考文献:http://docs.unity3d.com/Manual/TextualSceneFormat.html

Unity3D资源管理架构

标签:执行   format   date   pat   tcl   ada   使用   log   基于   

原文地址:http://www.cnblogs.com/zhchoutai/p/7210958.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!