mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
[unity] Added support for BlendModeMaterials to runtime instantiation from files. Closes #2542.
This commit is contained in:
parent
17da13d432
commit
1237174712
@ -158,6 +158,7 @@
|
|||||||
- `SkeletonRenderTexture` example components now provide a `shaderPasses` parameter to customize which passes are rendered to the `RenderTexture`. It defaults to `-1` for all passes to keep the existing behaviour. You might want to set it to `0` to only render the first pass e.g. to avoid issues when using a URP shader at the original skeleton.
|
- `SkeletonRenderTexture` example components now provide a `shaderPasses` parameter to customize which passes are rendered to the `RenderTexture`. It defaults to `-1` for all passes to keep the existing behaviour. You might want to set it to `0` to only render the first pass e.g. to avoid issues when using a URP shader at the original skeleton.
|
||||||
- `SkeletonGraphicRenderTexture` example component now also received a `quadMaterial` property, defaulting to the newly added Material asset `RenderQuadGraphicMaterial` which applies proper premultiplied-alpha blending of the render texture. The `quadMaterial` member variable was moved from `SkeletonRenderTexture` to the common base class `SkeletonRenderTextureBase`.
|
- `SkeletonGraphicRenderTexture` example component now also received a `quadMaterial` property, defaulting to the newly added Material asset `RenderQuadGraphicMaterial` which applies proper premultiplied-alpha blending of the render texture. The `quadMaterial` member variable was moved from `SkeletonRenderTexture` to the common base class `SkeletonRenderTextureBase`.
|
||||||
- All Spine Outline shaders, including the URP outline shader, now provide an additional parameter `Width in Screen Space`. Enable it to keep the outline width constant in screen space instead of texture space. Requires more expensive computations, so enable only where necessary. Defaults to `disabled` to maintain existing behaviour.
|
- All Spine Outline shaders, including the URP outline shader, now provide an additional parameter `Width in Screen Space`. Enable it to keep the outline width constant in screen space instead of texture space. Requires more expensive computations, so enable only where necessary. Defaults to `disabled` to maintain existing behaviour.
|
||||||
|
- Added support for BlendModeMaterials at runtime instantiation from files via an additional method `SkeletonDataAsset.SetupRuntimeBlendModeMaterials`. See example scene `Spine Examples/Other Examples/Instantiate from Script` for a usage example.
|
||||||
|
|
||||||
- **Breaking changes**
|
- **Breaking changes**
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,7 @@ OcclusionCullingSettings:
|
|||||||
--- !u!104 &2
|
--- !u!104 &2
|
||||||
RenderSettings:
|
RenderSettings:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
serializedVersion: 8
|
serializedVersion: 10
|
||||||
m_Fog: 0
|
m_Fog: 0
|
||||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||||
m_FogMode: 3
|
m_FogMode: 3
|
||||||
@ -39,37 +39,33 @@ RenderSettings:
|
|||||||
m_CustomReflection: {fileID: 0}
|
m_CustomReflection: {fileID: 0}
|
||||||
m_Sun: {fileID: 0}
|
m_Sun: {fileID: 0}
|
||||||
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
|
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
|
||||||
|
m_UseRadianceAmbientProbe: 0
|
||||||
--- !u!157 &3
|
--- !u!157 &3
|
||||||
LightmapSettings:
|
LightmapSettings:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
serializedVersion: 11
|
serializedVersion: 12
|
||||||
m_GIWorkflowMode: 1
|
|
||||||
m_GISettings:
|
m_GISettings:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_BounceScale: 1
|
m_BounceScale: 1
|
||||||
m_IndirectOutputScale: 1
|
m_IndirectOutputScale: 1
|
||||||
m_AlbedoBoost: 1
|
m_AlbedoBoost: 1
|
||||||
m_TemporalCoherenceThreshold: 1
|
|
||||||
m_EnvironmentLightingMode: 0
|
m_EnvironmentLightingMode: 0
|
||||||
m_EnableBakedLightmaps: 0
|
m_EnableBakedLightmaps: 0
|
||||||
m_EnableRealtimeLightmaps: 0
|
m_EnableRealtimeLightmaps: 0
|
||||||
m_LightmapEditorSettings:
|
m_LightmapEditorSettings:
|
||||||
serializedVersion: 9
|
serializedVersion: 12
|
||||||
m_Resolution: 2
|
m_Resolution: 2
|
||||||
m_BakeResolution: 40
|
m_BakeResolution: 40
|
||||||
m_TextureWidth: 1024
|
m_AtlasSize: 1024
|
||||||
m_TextureHeight: 1024
|
|
||||||
m_AO: 0
|
m_AO: 0
|
||||||
m_AOMaxDistance: 1
|
m_AOMaxDistance: 1
|
||||||
m_CompAOExponent: 1
|
m_CompAOExponent: 1
|
||||||
m_CompAOExponentDirect: 0
|
m_CompAOExponentDirect: 0
|
||||||
|
m_ExtractAmbientOcclusion: 0
|
||||||
m_Padding: 2
|
m_Padding: 2
|
||||||
m_LightmapParameters: {fileID: 0}
|
m_LightmapParameters: {fileID: 0}
|
||||||
m_LightmapsBakeMode: 1
|
m_LightmapsBakeMode: 1
|
||||||
m_TextureCompression: 1
|
m_TextureCompression: 1
|
||||||
m_FinalGather: 0
|
|
||||||
m_FinalGatherFiltering: 1
|
|
||||||
m_FinalGatherRayCount: 256
|
|
||||||
m_ReflectionCompression: 2
|
m_ReflectionCompression: 2
|
||||||
m_MixedBakeMode: 2
|
m_MixedBakeMode: 2
|
||||||
m_BakeBackend: 0
|
m_BakeBackend: 0
|
||||||
@ -77,23 +73,34 @@ LightmapSettings:
|
|||||||
m_PVRDirectSampleCount: 32
|
m_PVRDirectSampleCount: 32
|
||||||
m_PVRSampleCount: 500
|
m_PVRSampleCount: 500
|
||||||
m_PVRBounces: 2
|
m_PVRBounces: 2
|
||||||
m_PVRFiltering: 0
|
m_PVREnvironmentSampleCount: 500
|
||||||
m_PVRFilteringMode: 1
|
m_PVREnvironmentReferencePointCount: 2048
|
||||||
|
m_PVRFilteringMode: 2
|
||||||
|
m_PVRDenoiserTypeDirect: 0
|
||||||
|
m_PVRDenoiserTypeIndirect: 0
|
||||||
|
m_PVRDenoiserTypeAO: 0
|
||||||
|
m_PVRFilterTypeDirect: 0
|
||||||
|
m_PVRFilterTypeIndirect: 0
|
||||||
|
m_PVRFilterTypeAO: 0
|
||||||
|
m_PVREnvironmentMIS: 0
|
||||||
m_PVRCulling: 1
|
m_PVRCulling: 1
|
||||||
m_PVRFilteringGaussRadiusDirect: 1
|
m_PVRFilteringGaussRadiusDirect: 1
|
||||||
m_PVRFilteringGaussRadiusIndirect: 5
|
m_PVRFilteringGaussRadiusIndirect: 5
|
||||||
m_PVRFilteringGaussRadiusAO: 2
|
m_PVRFilteringGaussRadiusAO: 2
|
||||||
m_PVRFilteringAtrousColorSigma: 1
|
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||||
m_PVRFilteringAtrousNormalSigma: 1
|
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||||
m_PVRFilteringAtrousPositionSigma: 1
|
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||||
|
m_ExportTrainingData: 0
|
||||||
|
m_TrainingDataDestination: TrainingData
|
||||||
|
m_LightProbeSampleCountMultiplier: 4
|
||||||
m_LightingDataAsset: {fileID: 0}
|
m_LightingDataAsset: {fileID: 0}
|
||||||
m_UseShadowmask: 1
|
m_LightingSettings: {fileID: 1506007501}
|
||||||
--- !u!196 &4
|
--- !u!196 &4
|
||||||
NavMeshSettings:
|
NavMeshSettings:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_BuildSettings:
|
m_BuildSettings:
|
||||||
serializedVersion: 2
|
serializedVersion: 3
|
||||||
agentTypeID: 0
|
agentTypeID: 0
|
||||||
agentRadius: 0.5
|
agentRadius: 0.5
|
||||||
agentHeight: 2
|
agentHeight: 2
|
||||||
@ -106,20 +113,25 @@ NavMeshSettings:
|
|||||||
cellSize: 0.16666667
|
cellSize: 0.16666667
|
||||||
manualTileSize: 0
|
manualTileSize: 0
|
||||||
tileSize: 256
|
tileSize: 256
|
||||||
accuratePlacement: 0
|
buildHeightMesh: 0
|
||||||
|
maxJobWorkers: 0
|
||||||
|
preserveTilesOutsideBounds: 0
|
||||||
|
debug:
|
||||||
|
m_Flags: 0
|
||||||
m_NavMeshData: {fileID: 0}
|
m_NavMeshData: {fileID: 0}
|
||||||
--- !u!1 &92207858
|
--- !u!1 &92207858
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_PrefabParentObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInternal: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
serializedVersion: 5
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
m_Component:
|
m_Component:
|
||||||
- component: {fileID: 92207862}
|
- component: {fileID: 92207862}
|
||||||
- component: {fileID: 92207861}
|
- component: {fileID: 92207861}
|
||||||
- component: {fileID: 92207860}
|
- component: {fileID: 92207860}
|
||||||
m_Layer: 5
|
m_Layer: 5
|
||||||
m_Name: 3 Canvas - Spawn SkeletonGraphic Sample
|
m_Name: 2 Canvas - Spawn SkeletonGraphic Sample
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
@ -128,12 +140,13 @@ GameObject:
|
|||||||
--- !u!114 &92207860
|
--- !u!114 &92207860
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_PrefabParentObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInternal: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 92207858}
|
m_GameObject: {fileID: 92207858}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_UiScaleMode: 1
|
m_UiScaleMode: 1
|
||||||
@ -146,11 +159,13 @@ MonoBehaviour:
|
|||||||
m_FallbackScreenDPI: 96
|
m_FallbackScreenDPI: 96
|
||||||
m_DefaultSpriteDPI: 96
|
m_DefaultSpriteDPI: 96
|
||||||
m_DynamicPixelsPerUnit: 1
|
m_DynamicPixelsPerUnit: 1
|
||||||
|
m_PresetInfoIsWorld: 0
|
||||||
--- !u!223 &92207861
|
--- !u!223 &92207861
|
||||||
Canvas:
|
Canvas:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_PrefabParentObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInternal: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 92207858}
|
m_GameObject: {fileID: 92207858}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
@ -162,35 +177,122 @@ Canvas:
|
|||||||
m_OverrideSorting: 0
|
m_OverrideSorting: 0
|
||||||
m_OverridePixelPerfect: 0
|
m_OverridePixelPerfect: 0
|
||||||
m_SortingBucketNormalizedSize: 0
|
m_SortingBucketNormalizedSize: 0
|
||||||
|
m_VertexColorAlwaysGammaSpace: 0
|
||||||
m_AdditionalShaderChannelsFlag: 0
|
m_AdditionalShaderChannelsFlag: 0
|
||||||
|
m_UpdateRectTransformForStandalone: 0
|
||||||
m_SortingLayerID: 0
|
m_SortingLayerID: 0
|
||||||
m_SortingOrder: 0
|
m_SortingOrder: 0
|
||||||
m_TargetDisplay: 0
|
m_TargetDisplay: 0
|
||||||
--- !u!224 &92207862
|
--- !u!224 &92207862
|
||||||
RectTransform:
|
RectTransform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_PrefabParentObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInternal: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 92207858}
|
m_GameObject: {fileID: 92207858}
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 0, y: 0, z: 0}
|
m_LocalScale: {x: 0, y: 0, z: 0}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 1691562007}
|
- {fileID: 1691562007}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 3
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
m_AnchorMax: {x: 0, y: 0}
|
m_AnchorMax: {x: 0, y: 0}
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: 0, y: 0}
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
m_Pivot: {x: 0, y: 0}
|
m_Pivot: {x: 0, y: 0}
|
||||||
|
--- !u!1 &191860306
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 191860307}
|
||||||
|
- component: {fileID: 191860309}
|
||||||
|
- component: {fileID: 191860308}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: Canvas
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &191860307
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 191860306}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 0, y: 0, z: 0}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 1200587070}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
|
m_AnchorMax: {x: 0, y: 0}
|
||||||
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
|
m_Pivot: {x: 0, y: 0}
|
||||||
|
--- !u!114 &191860308
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 191860306}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_UiScaleMode: 1
|
||||||
|
m_ReferencePixelsPerUnit: 100
|
||||||
|
m_ScaleFactor: 1
|
||||||
|
m_ReferenceResolution: {x: 1920, y: 1080}
|
||||||
|
m_ScreenMatchMode: 0
|
||||||
|
m_MatchWidthOrHeight: 0
|
||||||
|
m_PhysicalUnit: 3
|
||||||
|
m_FallbackScreenDPI: 96
|
||||||
|
m_DefaultSpriteDPI: 96
|
||||||
|
m_DynamicPixelsPerUnit: 1
|
||||||
|
m_PresetInfoIsWorld: 0
|
||||||
|
--- !u!223 &191860309
|
||||||
|
Canvas:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 191860306}
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 3
|
||||||
|
m_RenderMode: 0
|
||||||
|
m_Camera: {fileID: 0}
|
||||||
|
m_PlaneDistance: 100
|
||||||
|
m_PixelPerfect: 0
|
||||||
|
m_ReceivesEvents: 1
|
||||||
|
m_OverrideSorting: 0
|
||||||
|
m_OverridePixelPerfect: 0
|
||||||
|
m_SortingBucketNormalizedSize: 0
|
||||||
|
m_VertexColorAlwaysGammaSpace: 0
|
||||||
|
m_AdditionalShaderChannelsFlag: 0
|
||||||
|
m_UpdateRectTransformForStandalone: 0
|
||||||
|
m_SortingLayerID: 0
|
||||||
|
m_SortingOrder: 0
|
||||||
|
m_TargetDisplay: 0
|
||||||
--- !u!1 &433620963
|
--- !u!1 &433620963
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_PrefabParentObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInternal: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
serializedVersion: 5
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
m_Component:
|
m_Component:
|
||||||
- component: {fileID: 433620968}
|
- component: {fileID: 433620968}
|
||||||
- component: {fileID: 433620967}
|
- component: {fileID: 433620967}
|
||||||
@ -206,27 +308,44 @@ GameObject:
|
|||||||
--- !u!81 &433620964
|
--- !u!81 &433620964
|
||||||
AudioListener:
|
AudioListener:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_PrefabParentObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInternal: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 433620963}
|
m_GameObject: {fileID: 433620963}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
--- !u!124 &433620965
|
--- !u!124 &433620965
|
||||||
Behaviour:
|
Behaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_PrefabParentObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInternal: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 433620963}
|
m_GameObject: {fileID: 433620963}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
--- !u!20 &433620967
|
--- !u!20 &433620967
|
||||||
Camera:
|
Camera:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_PrefabParentObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInternal: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 433620963}
|
m_GameObject: {fileID: 433620963}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_ClearFlags: 1
|
m_ClearFlags: 1
|
||||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||||
|
m_projectionMatrixMode: 1
|
||||||
|
m_GateFitMode: 2
|
||||||
|
m_FOVAxisMode: 0
|
||||||
|
m_Iso: 200
|
||||||
|
m_ShutterSpeed: 0.005
|
||||||
|
m_Aperture: 16
|
||||||
|
m_FocusDistance: 10
|
||||||
|
m_FocalLength: 50
|
||||||
|
m_BladeCount: 5
|
||||||
|
m_Curvature: {x: 2, y: 11}
|
||||||
|
m_BarrelClipping: 0.25
|
||||||
|
m_Anamorphism: 0
|
||||||
|
m_SensorSize: {x: 36, y: 24}
|
||||||
|
m_LensShift: {x: 0, y: 0}
|
||||||
m_NormalizedViewPortRect:
|
m_NormalizedViewPortRect:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
x: 0
|
x: 0
|
||||||
@ -248,35 +367,38 @@ Camera:
|
|||||||
m_TargetEye: 3
|
m_TargetEye: 3
|
||||||
m_HDR: 1
|
m_HDR: 1
|
||||||
m_AllowMSAA: 1
|
m_AllowMSAA: 1
|
||||||
|
m_AllowDynamicResolution: 0
|
||||||
m_ForceIntoRT: 0
|
m_ForceIntoRT: 0
|
||||||
m_OcclusionCulling: 1
|
m_OcclusionCulling: 1
|
||||||
m_StereoConvergence: 10
|
m_StereoConvergence: 10
|
||||||
m_StereoSeparation: 0.022
|
m_StereoSeparation: 0.022
|
||||||
m_StereoMirrorMode: 0
|
|
||||||
--- !u!4 &433620968
|
--- !u!4 &433620968
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_PrefabParentObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInternal: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 433620963}
|
m_GameObject: {fileID: 433620963}
|
||||||
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: -10}
|
m_LocalPosition: {x: 0, y: 0, z: -10}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 0
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!1 &651278528
|
--- !u!1 &651278528
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_PrefabParentObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInternal: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
serializedVersion: 5
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
m_Component:
|
m_Component:
|
||||||
- component: {fileID: 651278530}
|
- component: {fileID: 651278530}
|
||||||
- component: {fileID: 651278529}
|
- component: {fileID: 651278529}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: 2 RuntimeLoadFromExports
|
m_Name: 3 RuntimeLoadFromExports
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
@ -285,8 +407,9 @@ GameObject:
|
|||||||
--- !u!114 &651278529
|
--- !u!114 &651278529
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_PrefabParentObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInternal: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 651278528}
|
m_GameObject: {fileID: 651278528}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
@ -297,27 +420,251 @@ MonoBehaviour:
|
|||||||
atlasText: {fileID: 4900000, guid: 5c0a5c36970a46e4d8378760ab4a4cfc, type: 3}
|
atlasText: {fileID: 4900000, guid: 5c0a5c36970a46e4d8378760ab4a4cfc, type: 3}
|
||||||
textures:
|
textures:
|
||||||
- {fileID: 2800000, guid: 49bb65eefe08e424bbf7a38bc98ec638, type: 3}
|
- {fileID: 2800000, guid: 49bb65eefe08e424bbf7a38bc98ec638, type: 3}
|
||||||
materialPropertySource: {fileID: 2100000, guid: 1455e88fdb81ccc45bdeaedd657bad4d,
|
materialPropertySource: {fileID: 2100000, guid: 1455e88fdb81ccc45bdeaedd657bad4d, type: 2}
|
||||||
type: 2}
|
delay: 0
|
||||||
|
skinName:
|
||||||
|
animationName:
|
||||||
|
blendModeMaterials: 0
|
||||||
|
applyAdditiveMaterial: 0
|
||||||
|
blendModeTemplateMaterials:
|
||||||
|
additiveTemplate: {fileID: 0}
|
||||||
|
multiplyTemplate: {fileID: 0}
|
||||||
|
screenTemplate: {fileID: 0}
|
||||||
|
graphicBlendModeMaterials:
|
||||||
|
additiveTemplate: {fileID: 0}
|
||||||
|
multiplyTemplate: {fileID: 0}
|
||||||
|
screenTemplate: {fileID: 0}
|
||||||
|
skeletonGraphicMaterial: {fileID: 2100000, guid: b66cf7a186d13054989b33a5c90044e4, type: 2}
|
||||||
--- !u!4 &651278530
|
--- !u!4 &651278530
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_PrefabParentObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInternal: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 651278528}
|
m_GameObject: {fileID: 651278528}
|
||||||
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children: []
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children:
|
||||||
|
- {fileID: 1025308469}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 2
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!1 &1025308468
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1025308469}
|
||||||
|
- component: {fileID: 1025308472}
|
||||||
|
- component: {fileID: 1025308471}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: Canvas
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &1025308469
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1025308468}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 0, y: 0, z: 0}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 651278530}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
|
m_AnchorMax: {x: 0, y: 0}
|
||||||
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
|
m_Pivot: {x: 0, y: 0}
|
||||||
|
--- !u!114 &1025308471
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1025308468}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_UiScaleMode: 1
|
||||||
|
m_ReferencePixelsPerUnit: 100
|
||||||
|
m_ScaleFactor: 1
|
||||||
|
m_ReferenceResolution: {x: 1920, y: 1080}
|
||||||
|
m_ScreenMatchMode: 0
|
||||||
|
m_MatchWidthOrHeight: 0
|
||||||
|
m_PhysicalUnit: 3
|
||||||
|
m_FallbackScreenDPI: 96
|
||||||
|
m_DefaultSpriteDPI: 96
|
||||||
|
m_DynamicPixelsPerUnit: 1
|
||||||
|
m_PresetInfoIsWorld: 0
|
||||||
|
--- !u!223 &1025308472
|
||||||
|
Canvas:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1025308468}
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 3
|
||||||
|
m_RenderMode: 0
|
||||||
|
m_Camera: {fileID: 0}
|
||||||
|
m_PlaneDistance: 100
|
||||||
|
m_PixelPerfect: 0
|
||||||
|
m_ReceivesEvents: 1
|
||||||
|
m_OverrideSorting: 0
|
||||||
|
m_OverridePixelPerfect: 0
|
||||||
|
m_SortingBucketNormalizedSize: 0
|
||||||
|
m_VertexColorAlwaysGammaSpace: 0
|
||||||
|
m_AdditionalShaderChannelsFlag: 0
|
||||||
|
m_UpdateRectTransformForStandalone: 0
|
||||||
|
m_SortingLayerID: 0
|
||||||
|
m_SortingOrder: 0
|
||||||
|
m_TargetDisplay: 0
|
||||||
|
--- !u!1 &1200587068
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1200587070}
|
||||||
|
- component: {fileID: 1200587069}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: 4 Runtime BlendModes from Exports
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!114 &1200587069
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1200587068}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: bb0837af7345d504db63d0c662fd12dc, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
skeletonJson: {fileID: 4900000, guid: 1a6f51aad0fef5a40aeedfeec5c0b8b2, type: 3}
|
||||||
|
atlasText: {fileID: 4900000, guid: 188756a89517d7649a67fb53606220f5, type: 3}
|
||||||
|
textures:
|
||||||
|
- {fileID: 2800000, guid: dc1b9f9665c8aa74799404a1d2038e3d, type: 3}
|
||||||
|
materialPropertySource: {fileID: 2100000, guid: 1455e88fdb81ccc45bdeaedd657bad4d, type: 2}
|
||||||
|
delay: 0
|
||||||
|
skinName:
|
||||||
|
animationName:
|
||||||
|
blendModeMaterials: 1
|
||||||
|
applyAdditiveMaterial: 0
|
||||||
|
blendModeTemplateMaterials:
|
||||||
|
additiveTemplate: {fileID: 2100000, guid: 4deba332d47209e4780b3c5fcf0e3745, type: 2}
|
||||||
|
multiplyTemplate: {fileID: 2100000, guid: 53bf0ab317d032d418cf1252d68f51df, type: 2}
|
||||||
|
screenTemplate: {fileID: 2100000, guid: 73f0f46d3177c614baf0fa48d646a9be, type: 2}
|
||||||
|
graphicBlendModeMaterials:
|
||||||
|
additiveTemplate: {fileID: 2100000, guid: 2e8245019faeb8c43b75f9ca3ac8ee34, type: 2}
|
||||||
|
multiplyTemplate: {fileID: 2100000, guid: e74a1f8978a7da348a721508d0d58834, type: 2}
|
||||||
|
screenTemplate: {fileID: 2100000, guid: bab24c479f34eec45be6ea8595891569, type: 2}
|
||||||
|
skeletonGraphicMaterial: {fileID: 2100000, guid: b66cf7a186d13054989b33a5c90044e4, type: 2}
|
||||||
|
--- !u!4 &1200587070
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1200587068}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children:
|
||||||
|
- {fileID: 191860307}
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!850595691 &1506007501
|
||||||
|
LightingSettings:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: Settings.lighting
|
||||||
|
serializedVersion: 8
|
||||||
|
m_EnableBakedLightmaps: 0
|
||||||
|
m_EnableRealtimeLightmaps: 0
|
||||||
|
m_RealtimeEnvironmentLighting: 1
|
||||||
|
m_BounceScale: 1
|
||||||
|
m_AlbedoBoost: 1
|
||||||
|
m_IndirectOutputScale: 1
|
||||||
|
m_UsingShadowmask: 1
|
||||||
|
m_BakeBackend: 1
|
||||||
|
m_LightmapMaxSize: 1024
|
||||||
|
m_LightmapSizeFixed: 0
|
||||||
|
m_UseMipmapLimits: 1
|
||||||
|
m_BakeResolution: 40
|
||||||
|
m_Padding: 2
|
||||||
|
m_LightmapCompression: 3
|
||||||
|
m_AO: 0
|
||||||
|
m_AOMaxDistance: 1
|
||||||
|
m_CompAOExponent: 1
|
||||||
|
m_CompAOExponentDirect: 0
|
||||||
|
m_ExtractAO: 0
|
||||||
|
m_MixedBakeMode: 2
|
||||||
|
m_LightmapsBakeMode: 1
|
||||||
|
m_FilterMode: 1
|
||||||
|
m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_ExportTrainingData: 0
|
||||||
|
m_TrainingDataDestination: TrainingData
|
||||||
|
m_RealtimeResolution: 2
|
||||||
|
m_ForceWhiteAlbedo: 0
|
||||||
|
m_ForceUpdates: 0
|
||||||
|
m_PVRCulling: 1
|
||||||
|
m_PVRSampling: 1
|
||||||
|
m_PVRDirectSampleCount: 32
|
||||||
|
m_PVRSampleCount: 512
|
||||||
|
m_PVREnvironmentSampleCount: 512
|
||||||
|
m_PVREnvironmentReferencePointCount: 2048
|
||||||
|
m_LightProbeSampleCountMultiplier: 4
|
||||||
|
m_PVRBounces: 2
|
||||||
|
m_PVRMinBounces: 2
|
||||||
|
m_PVREnvironmentImportanceSampling: 0
|
||||||
|
m_PVRFilteringMode: 2
|
||||||
|
m_PVRDenoiserTypeDirect: 0
|
||||||
|
m_PVRDenoiserTypeIndirect: 0
|
||||||
|
m_PVRDenoiserTypeAO: 0
|
||||||
|
m_PVRFilterTypeDirect: 0
|
||||||
|
m_PVRFilterTypeIndirect: 0
|
||||||
|
m_PVRFilterTypeAO: 0
|
||||||
|
m_PVRFilteringGaussRadiusDirect: 1
|
||||||
|
m_PVRFilteringGaussRadiusIndirect: 5
|
||||||
|
m_PVRFilteringGaussRadiusAO: 2
|
||||||
|
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||||
|
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||||
|
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||||
|
m_RespectSceneVisibilityWhenBakingGI: 0
|
||||||
--- !u!1 &1691562006
|
--- !u!1 &1691562006
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_PrefabParentObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInternal: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
serializedVersion: 5
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
m_Component:
|
m_Component:
|
||||||
- component: {fileID: 1691562007}
|
- component: {fileID: 1691562007}
|
||||||
- component: {fileID: 1691562008}
|
- component: {fileID: 1691562008}
|
||||||
@ -331,15 +678,16 @@ GameObject:
|
|||||||
--- !u!224 &1691562007
|
--- !u!224 &1691562007
|
||||||
RectTransform:
|
RectTransform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_PrefabParentObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInternal: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1691562006}
|
m_GameObject: {fileID: 1691562006}
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 92207862}
|
m_Father: {fileID: 92207862}
|
||||||
m_RootOrder: 0
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||||
@ -349,8 +697,9 @@ RectTransform:
|
|||||||
--- !u!114 &1691562008
|
--- !u!114 &1691562008
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_PrefabParentObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInternal: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1691562006}
|
m_GameObject: {fileID: 1691562006}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
@ -360,14 +709,14 @@ MonoBehaviour:
|
|||||||
skeletonDataAsset: {fileID: 11400000, guid: a467507a4ffb1d542a558739b2fede77, type: 2}
|
skeletonDataAsset: {fileID: 11400000, guid: a467507a4ffb1d542a558739b2fede77, type: 2}
|
||||||
startingAnimation: run
|
startingAnimation: run
|
||||||
startingSkin: base
|
startingSkin: base
|
||||||
skeletonGraphicMaterial: {fileID: 2100000, guid: 1455e88fdb81ccc45bdeaedd657bad4d,
|
skeletonGraphicMaterial: {fileID: 2100000, guid: b66cf7a186d13054989b33a5c90044e4, type: 2}
|
||||||
type: 2}
|
|
||||||
--- !u!1 &1807176298
|
--- !u!1 &1807176298
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_PrefabParentObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInternal: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
serializedVersion: 5
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
m_Component:
|
m_Component:
|
||||||
- component: {fileID: 1807176300}
|
- component: {fileID: 1807176300}
|
||||||
- component: {fileID: 1807176299}
|
- component: {fileID: 1807176299}
|
||||||
@ -381,8 +730,9 @@ GameObject:
|
|||||||
--- !u!114 &1807176299
|
--- !u!114 &1807176299
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_PrefabParentObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInternal: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1807176298}
|
m_GameObject: {fileID: 1807176298}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
@ -395,13 +745,93 @@ MonoBehaviour:
|
|||||||
--- !u!4 &1807176300
|
--- !u!4 &1807176300
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_PrefabParentObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInternal: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1807176298}
|
m_GameObject: {fileID: 1807176298}
|
||||||
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 1
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!1 &1924218899
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1924218902}
|
||||||
|
- component: {fileID: 1924218901}
|
||||||
|
- component: {fileID: 1924218900}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: EventSystem
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!114 &1924218900
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1924218899}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_SendPointerHoverToParent: 1
|
||||||
|
m_HorizontalAxis: Horizontal
|
||||||
|
m_VerticalAxis: Vertical
|
||||||
|
m_SubmitButton: Submit
|
||||||
|
m_CancelButton: Cancel
|
||||||
|
m_InputActionsPerSecond: 10
|
||||||
|
m_RepeatDelay: 0.5
|
||||||
|
m_ForceModuleActive: 0
|
||||||
|
--- !u!114 &1924218901
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1924218899}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_FirstSelected: {fileID: 0}
|
||||||
|
m_sendNavigationEvents: 1
|
||||||
|
m_DragThreshold: 10
|
||||||
|
--- !u!4 &1924218902
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1924218899}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!1660057539 &9223372036854775807
|
||||||
|
SceneRoots:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_Roots:
|
||||||
|
- {fileID: 433620968}
|
||||||
|
- {fileID: 1807176300}
|
||||||
|
- {fileID: 92207862}
|
||||||
|
- {fileID: 651278530}
|
||||||
|
- {fileID: 1200587070}
|
||||||
|
- {fileID: 1924218902}
|
||||||
|
|||||||
@ -46,14 +46,27 @@ namespace Spine.Unity.Examples {
|
|||||||
SpineAtlasAsset runtimeAtlasAsset;
|
SpineAtlasAsset runtimeAtlasAsset;
|
||||||
SkeletonDataAsset runtimeSkeletonDataAsset;
|
SkeletonDataAsset runtimeSkeletonDataAsset;
|
||||||
SkeletonAnimation runtimeSkeletonAnimation;
|
SkeletonAnimation runtimeSkeletonAnimation;
|
||||||
|
SkeletonGraphic runtimeSkeletonGraphic;
|
||||||
|
|
||||||
|
public bool blendModeMaterials = false;
|
||||||
|
public bool applyAdditiveMaterial = false;
|
||||||
|
public BlendModeMaterials.TemplateMaterials blendModeTemplateMaterials;
|
||||||
|
public BlendModeMaterials.TemplateMaterials graphicBlendModeMaterials;
|
||||||
|
public Material skeletonGraphicMaterial;
|
||||||
|
|
||||||
void CreateRuntimeAssetsAndGameObject () {
|
void CreateRuntimeAssetsAndGameObject () {
|
||||||
// 1. Create the AtlasAsset (needs atlas text asset and textures, and materials/shader);
|
// 1. Create the AtlasAsset (needs atlas text asset and textures, and materials/shader);
|
||||||
// 2. Create SkeletonDataAsset (needs json or binary asset file, and an AtlasAsset)
|
// 2. Create SkeletonDataAsset (needs json or binary asset file, and an AtlasAsset)
|
||||||
// 3. Create SkeletonAnimation (needs a valid SkeletonDataAsset)
|
// 2.1 Optional: Setup blend mode materials at SkeletonDataAsset. Only required if the skeleton
|
||||||
|
// uses blend modes which require blend mode materials.
|
||||||
|
// 3.a Create SkeletonAnimation (needs a valid SkeletonDataAsset)
|
||||||
|
// 3.b Create SkeletonGraphic (needs a valid SkeletonDataAsset)
|
||||||
|
|
||||||
runtimeAtlasAsset = SpineAtlasAsset.CreateRuntimeInstance(atlasText, textures, materialPropertySource, true);
|
runtimeAtlasAsset = SpineAtlasAsset.CreateRuntimeInstance(atlasText, textures, materialPropertySource, true, null, true);
|
||||||
runtimeSkeletonDataAsset = SkeletonDataAsset.CreateRuntimeInstance(skeletonJson, runtimeAtlasAsset, true);
|
runtimeSkeletonDataAsset = SkeletonDataAsset.CreateRuntimeInstance(skeletonJson, runtimeAtlasAsset, true);
|
||||||
|
if (blendModeMaterials)
|
||||||
|
runtimeSkeletonDataAsset.SetupRuntimeBlendModeMaterials(
|
||||||
|
applyAdditiveMaterial, blendModeTemplateMaterials);
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerator Start () {
|
IEnumerator Start () {
|
||||||
@ -62,7 +75,15 @@ namespace Spine.Unity.Examples {
|
|||||||
runtimeSkeletonDataAsset.GetSkeletonData(false); // preload
|
runtimeSkeletonDataAsset.GetSkeletonData(false); // preload
|
||||||
yield return new WaitForSeconds(delay);
|
yield return new WaitForSeconds(delay);
|
||||||
}
|
}
|
||||||
|
InstantiateSkeletonAnimation();
|
||||||
|
|
||||||
|
InstantiateSkeletonGraphic();
|
||||||
|
}
|
||||||
|
|
||||||
|
void InstantiateSkeletonAnimation () {
|
||||||
runtimeSkeletonAnimation = SkeletonAnimation.NewSkeletonAnimationGameObject(runtimeSkeletonDataAsset);
|
runtimeSkeletonAnimation = SkeletonAnimation.NewSkeletonAnimationGameObject(runtimeSkeletonDataAsset);
|
||||||
|
runtimeSkeletonAnimation.transform.parent = transform;
|
||||||
|
runtimeSkeletonAnimation.name = "SkeletonAnimation Instance";
|
||||||
|
|
||||||
// additional initialization
|
// additional initialization
|
||||||
runtimeSkeletonAnimation.Initialize(false);
|
runtimeSkeletonAnimation.Initialize(false);
|
||||||
@ -72,6 +93,28 @@ namespace Spine.Unity.Examples {
|
|||||||
if (animationName != "")
|
if (animationName != "")
|
||||||
runtimeSkeletonAnimation.AnimationState.SetAnimation(0, animationName, true);
|
runtimeSkeletonAnimation.AnimationState.SetAnimation(0, animationName, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InstantiateSkeletonGraphic () {
|
||||||
|
Canvas canvas = this.GetComponentInChildren<Canvas>();
|
||||||
|
Transform parent = canvas.transform;
|
||||||
|
|
||||||
|
runtimeSkeletonGraphic = SkeletonGraphic.NewSkeletonGraphicGameObject(runtimeSkeletonDataAsset, parent, skeletonGraphicMaterial);
|
||||||
|
runtimeSkeletonGraphic.name = "SkeletonGraphic Instance";
|
||||||
|
|
||||||
|
if (blendModeMaterials) {
|
||||||
|
runtimeSkeletonGraphic.allowMultipleCanvasRenderers = true;
|
||||||
|
runtimeSkeletonGraphic.additiveMaterial = graphicBlendModeMaterials.additiveTemplate;
|
||||||
|
runtimeSkeletonGraphic.multiplyMaterial = graphicBlendModeMaterials.multiplyTemplate;
|
||||||
|
runtimeSkeletonGraphic.screenMaterial = graphicBlendModeMaterials.screenTemplate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// additional initialization
|
||||||
|
runtimeSkeletonGraphic.Initialize(false);
|
||||||
|
if (skinName != "")
|
||||||
|
runtimeSkeletonGraphic.Skeleton.SetSkin(skinName);
|
||||||
|
runtimeSkeletonGraphic.Skeleton.SetSlotsToSetupPose();
|
||||||
|
if (animationName != "")
|
||||||
|
runtimeSkeletonGraphic.AnimationState.SetAnimation(0, animationName, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"name": "com.esotericsoftware.spine.spine-unity-examples",
|
"name": "com.esotericsoftware.spine.spine-unity-examples",
|
||||||
"displayName": "spine-unity Runtime Examples",
|
"displayName": "spine-unity Runtime Examples",
|
||||||
"description": "This plugin provides example scenes and scripts for the spine-unity runtime.",
|
"description": "This plugin provides example scenes and scripts for the spine-unity runtime.",
|
||||||
"version": "4.2.32",
|
"version": "4.2.33",
|
||||||
"unity": "2018.3",
|
"unity": "2018.3",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Esoteric Software",
|
"name": "Esoteric Software",
|
||||||
|
|||||||
@ -37,25 +37,19 @@ using UnityEditor;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Spine.Unity.Editor {
|
namespace Spine.Unity.Editor {
|
||||||
|
using TemplateMaterials = BlendModeMaterials.TemplateMaterials;
|
||||||
|
|
||||||
public class BlendModeMaterialsUtility {
|
public class BlendModeMaterialsUtility {
|
||||||
|
|
||||||
public const string MATERIAL_SUFFIX_MULTIPLY = "-Multiply";
|
public const string MATERIAL_SUFFIX_MULTIPLY = BlendModeMaterials.MATERIAL_SUFFIX_MULTIPLY;
|
||||||
public const string MATERIAL_SUFFIX_SCREEN = "-Screen";
|
public const string MATERIAL_SUFFIX_SCREEN = BlendModeMaterials.MATERIAL_SUFFIX_SCREEN;
|
||||||
public const string MATERIAL_SUFFIX_ADDITIVE = "-Additive";
|
public const string MATERIAL_SUFFIX_ADDITIVE = BlendModeMaterials.MATERIAL_SUFFIX_ADDITIVE;
|
||||||
|
|
||||||
#if UPGRADE_ALL_BLEND_MODE_MATERIALS
|
#if UPGRADE_ALL_BLEND_MODE_MATERIALS
|
||||||
public const bool ShallUpgradeBlendModeMaterials = true;
|
public const bool ShallUpgradeBlendModeMaterials = true;
|
||||||
#else
|
#else
|
||||||
public const bool ShallUpgradeBlendModeMaterials = false;
|
public const bool ShallUpgradeBlendModeMaterials = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
protected class TemplateMaterials {
|
|
||||||
public Material multiplyTemplate;
|
|
||||||
public Material screenTemplate;
|
|
||||||
public Material additiveTemplate;
|
|
||||||
};
|
|
||||||
|
|
||||||
public static void UpgradeBlendModeMaterials (SkeletonDataAsset skeletonDataAsset) {
|
public static void UpgradeBlendModeMaterials (SkeletonDataAsset skeletonDataAsset) {
|
||||||
SkeletonData skeletonData = skeletonDataAsset.GetSkeletonData(true);
|
SkeletonData skeletonData = skeletonDataAsset.GetSkeletonData(true);
|
||||||
if (skeletonData == null)
|
if (skeletonData == null)
|
||||||
@ -158,72 +152,11 @@ namespace Spine.Unity.Editor {
|
|||||||
protected static bool CreateAndAssignMaterials (SkeletonDataAsset skeletonDataAsset,
|
protected static bool CreateAndAssignMaterials (SkeletonDataAsset skeletonDataAsset,
|
||||||
TemplateMaterials templateMaterials, ref bool anyReplacementMaterialsChanged) {
|
TemplateMaterials templateMaterials, ref bool anyReplacementMaterialsChanged) {
|
||||||
|
|
||||||
bool anyCreationFailed = false;
|
return BlendModeMaterials.CreateAndAssignMaterials(skeletonDataAsset,
|
||||||
BlendModeMaterials blendModeMaterials = skeletonDataAsset.blendModeMaterials;
|
templateMaterials, ref anyReplacementMaterialsChanged,
|
||||||
bool applyAdditiveMaterial = blendModeMaterials.applyAdditiveMaterial;
|
SpineEditorUtilities.ClearSkeletonDataAsset,
|
||||||
|
EditorUtility.SetDirty,
|
||||||
List<Skin.SkinEntry> skinEntries = new List<Skin.SkinEntry>();
|
CreateForRegion);
|
||||||
|
|
||||||
SpineEditorUtilities.ClearSkeletonDataAsset(skeletonDataAsset);
|
|
||||||
skeletonDataAsset.isUpgradingBlendModeMaterials = true;
|
|
||||||
SkeletonData skeletonData = skeletonDataAsset.GetSkeletonData(true);
|
|
||||||
|
|
||||||
SlotData[] slotsItems = skeletonData.Slots.Items;
|
|
||||||
for (int slotIndex = 0, slotCount = skeletonData.Slots.Count; slotIndex < slotCount; slotIndex++) {
|
|
||||||
SlotData slot = slotsItems[slotIndex];
|
|
||||||
if (slot.BlendMode == BlendMode.Normal) continue;
|
|
||||||
if (!applyAdditiveMaterial && slot.BlendMode == BlendMode.Additive) continue;
|
|
||||||
|
|
||||||
List<BlendModeMaterials.ReplacementMaterial> replacementMaterials = null;
|
|
||||||
Material materialTemplate = null;
|
|
||||||
string materialSuffix = null;
|
|
||||||
switch (slot.BlendMode) {
|
|
||||||
case BlendMode.Multiply:
|
|
||||||
replacementMaterials = blendModeMaterials.multiplyMaterials;
|
|
||||||
materialTemplate = templateMaterials.multiplyTemplate;
|
|
||||||
materialSuffix = MATERIAL_SUFFIX_MULTIPLY;
|
|
||||||
break;
|
|
||||||
case BlendMode.Screen:
|
|
||||||
replacementMaterials = blendModeMaterials.screenMaterials;
|
|
||||||
materialTemplate = templateMaterials.screenTemplate;
|
|
||||||
materialSuffix = MATERIAL_SUFFIX_SCREEN;
|
|
||||||
break;
|
|
||||||
case BlendMode.Additive:
|
|
||||||
replacementMaterials = blendModeMaterials.additiveMaterials;
|
|
||||||
materialTemplate = templateMaterials.additiveTemplate;
|
|
||||||
materialSuffix = MATERIAL_SUFFIX_ADDITIVE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
skinEntries.Clear();
|
|
||||||
foreach (Skin skin in skeletonData.Skins)
|
|
||||||
skin.GetAttachments(slotIndex, skinEntries);
|
|
||||||
|
|
||||||
foreach (Skin.SkinEntry entry in skinEntries) {
|
|
||||||
IHasTextureRegion renderableAttachment = entry.Attachment as IHasTextureRegion;
|
|
||||||
if (renderableAttachment != null) {
|
|
||||||
AtlasRegion originalRegion = (AtlasRegion)renderableAttachment.Region;
|
|
||||||
if (originalRegion != null) {
|
|
||||||
anyCreationFailed |= CreateForRegion(
|
|
||||||
ref replacementMaterials, ref anyReplacementMaterialsChanged,
|
|
||||||
originalRegion, materialTemplate, materialSuffix, skeletonDataAsset);
|
|
||||||
} else {
|
|
||||||
Sequence sequence = renderableAttachment.Sequence;
|
|
||||||
if (sequence != null && sequence.Regions != null) {
|
|
||||||
for (int i = 0, count = sequence.Regions.Length; i < count; ++i) {
|
|
||||||
originalRegion = (AtlasRegion)sequence.Regions[i];
|
|
||||||
anyCreationFailed |= CreateForRegion(
|
|
||||||
ref replacementMaterials, ref anyReplacementMaterialsChanged,
|
|
||||||
originalRegion, materialTemplate, materialSuffix, skeletonDataAsset);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
skeletonDataAsset.isUpgradingBlendModeMaterials = false;
|
|
||||||
EditorUtility.SetDirty(skeletonDataAsset);
|
|
||||||
return !anyCreationFailed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static bool CreateForRegion (ref List<BlendModeMaterials.ReplacementMaterial> replacementMaterials,
|
protected static bool CreateForRegion (ref List<BlendModeMaterials.ReplacementMaterial> replacementMaterials,
|
||||||
|
|||||||
@ -37,6 +37,10 @@ namespace Spine.Unity {
|
|||||||
[System.Serializable]
|
[System.Serializable]
|
||||||
public class BlendModeMaterials {
|
public class BlendModeMaterials {
|
||||||
|
|
||||||
|
public const string MATERIAL_SUFFIX_MULTIPLY = "-Multiply";
|
||||||
|
public const string MATERIAL_SUFFIX_SCREEN = "-Screen";
|
||||||
|
public const string MATERIAL_SUFFIX_ADDITIVE = "-Additive";
|
||||||
|
|
||||||
[System.Serializable]
|
[System.Serializable]
|
||||||
public class ReplacementMaterial {
|
public class ReplacementMaterial {
|
||||||
public string pageName;
|
public string pageName;
|
||||||
@ -66,6 +70,7 @@ namespace Spine.Unity {
|
|||||||
public void TransferSettingsFrom (BlendModeMaterialsAsset modifierAsset) {
|
public void TransferSettingsFrom (BlendModeMaterialsAsset modifierAsset) {
|
||||||
applyAdditiveMaterial = modifierAsset.applyAdditiveMaterial;
|
applyAdditiveMaterial = modifierAsset.applyAdditiveMaterial;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
public bool UpdateBlendmodeMaterialsRequiredState (SkeletonData skeletonData) {
|
public bool UpdateBlendmodeMaterialsRequiredState (SkeletonData skeletonData) {
|
||||||
requiresBlendModeMaterials = false;
|
requiresBlendModeMaterials = false;
|
||||||
@ -92,7 +97,146 @@ namespace Spine.Unity {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
[System.Serializable]
|
||||||
|
public class TemplateMaterials {
|
||||||
|
public Material additiveTemplate;
|
||||||
|
public Material multiplyTemplate;
|
||||||
|
public Material screenTemplate;
|
||||||
|
};
|
||||||
|
|
||||||
|
public delegate bool CreateForRegionDelegate (ref List<BlendModeMaterials.ReplacementMaterial> replacementMaterials,
|
||||||
|
ref bool anyReplacementMaterialsChanged,
|
||||||
|
AtlasRegion originalRegion, Material materialTemplate, string materialSuffix,
|
||||||
|
SkeletonDataAsset skeletonDataAsset);
|
||||||
|
|
||||||
|
public static bool CreateAndAssignMaterials (SkeletonDataAsset skeletonDataAsset,
|
||||||
|
TemplateMaterials templateMaterials, ref bool anyReplacementMaterialsChanged) {
|
||||||
|
|
||||||
|
return CreateAndAssignMaterials(skeletonDataAsset,
|
||||||
|
templateMaterials, ref anyReplacementMaterialsChanged,
|
||||||
|
(asset) => { asset.Clear(); }, null, CreateForRegion);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool CreateAndAssignMaterials (SkeletonDataAsset skeletonDataAsset,
|
||||||
|
TemplateMaterials templateMaterials, ref bool anyReplacementMaterialsChanged,
|
||||||
|
System.Action<SkeletonDataAsset> clearSkeletonDataAssetFunc,
|
||||||
|
System.Action<SkeletonDataAsset> afterAssetModifiedFunc,
|
||||||
|
CreateForRegionDelegate createForRegionFunc) {
|
||||||
|
|
||||||
|
bool anyCreationFailed = false;
|
||||||
|
BlendModeMaterials blendModeMaterials = skeletonDataAsset.blendModeMaterials;
|
||||||
|
bool applyAdditiveMaterial = blendModeMaterials.applyAdditiveMaterial;
|
||||||
|
|
||||||
|
List<Skin.SkinEntry> skinEntries = new List<Skin.SkinEntry>();
|
||||||
|
|
||||||
|
clearSkeletonDataAssetFunc(skeletonDataAsset);
|
||||||
|
skeletonDataAsset.isUpgradingBlendModeMaterials = true;
|
||||||
|
SkeletonData skeletonData = skeletonDataAsset.GetSkeletonData(true);
|
||||||
|
|
||||||
|
SlotData[] slotsItems = skeletonData.Slots.Items;
|
||||||
|
for (int slotIndex = 0, slotCount = skeletonData.Slots.Count; slotIndex < slotCount; slotIndex++) {
|
||||||
|
SlotData slot = slotsItems[slotIndex];
|
||||||
|
if (slot.BlendMode == BlendMode.Normal) continue;
|
||||||
|
if (!applyAdditiveMaterial && slot.BlendMode == BlendMode.Additive) continue;
|
||||||
|
|
||||||
|
List<BlendModeMaterials.ReplacementMaterial> replacementMaterials = null;
|
||||||
|
Material materialTemplate = null;
|
||||||
|
string materialSuffix = null;
|
||||||
|
switch (slot.BlendMode) {
|
||||||
|
case BlendMode.Multiply:
|
||||||
|
replacementMaterials = blendModeMaterials.multiplyMaterials;
|
||||||
|
materialTemplate = templateMaterials.multiplyTemplate;
|
||||||
|
materialSuffix = MATERIAL_SUFFIX_MULTIPLY;
|
||||||
|
break;
|
||||||
|
case BlendMode.Screen:
|
||||||
|
replacementMaterials = blendModeMaterials.screenMaterials;
|
||||||
|
materialTemplate = templateMaterials.screenTemplate;
|
||||||
|
materialSuffix = MATERIAL_SUFFIX_SCREEN;
|
||||||
|
break;
|
||||||
|
case BlendMode.Additive:
|
||||||
|
replacementMaterials = blendModeMaterials.additiveMaterials;
|
||||||
|
materialTemplate = templateMaterials.additiveTemplate;
|
||||||
|
materialSuffix = MATERIAL_SUFFIX_ADDITIVE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
skinEntries.Clear();
|
||||||
|
foreach (Skin skin in skeletonData.Skins)
|
||||||
|
skin.GetAttachments(slotIndex, skinEntries);
|
||||||
|
|
||||||
|
foreach (Skin.SkinEntry entry in skinEntries) {
|
||||||
|
IHasTextureRegion renderableAttachment = entry.Attachment as IHasTextureRegion;
|
||||||
|
if (renderableAttachment != null) {
|
||||||
|
AtlasRegion originalRegion = (AtlasRegion)renderableAttachment.Region;
|
||||||
|
if (originalRegion != null) {
|
||||||
|
anyCreationFailed |= createForRegionFunc(
|
||||||
|
ref replacementMaterials, ref anyReplacementMaterialsChanged,
|
||||||
|
originalRegion, materialTemplate, materialSuffix, skeletonDataAsset);
|
||||||
|
} else {
|
||||||
|
Sequence sequence = renderableAttachment.Sequence;
|
||||||
|
if (sequence != null && sequence.Regions != null) {
|
||||||
|
for (int i = 0, count = sequence.Regions.Length; i < count; ++i) {
|
||||||
|
originalRegion = (AtlasRegion)sequence.Regions[i];
|
||||||
|
anyCreationFailed |= createForRegionFunc(
|
||||||
|
ref replacementMaterials, ref anyReplacementMaterialsChanged,
|
||||||
|
originalRegion, materialTemplate, materialSuffix, skeletonDataAsset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
skeletonDataAsset.isUpgradingBlendModeMaterials = false;
|
||||||
|
if (afterAssetModifiedFunc != null) afterAssetModifiedFunc(skeletonDataAsset);
|
||||||
|
return !anyCreationFailed;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static bool CreateForRegion (ref List<BlendModeMaterials.ReplacementMaterial> replacementMaterials,
|
||||||
|
ref bool anyReplacementMaterialsChanged,
|
||||||
|
AtlasRegion originalRegion, Material materialTemplate, string materialSuffix,
|
||||||
|
SkeletonDataAsset skeletonDataAsset) {
|
||||||
|
|
||||||
|
bool anyCreationFailed = false;
|
||||||
|
bool replacementExists = replacementMaterials.Exists(
|
||||||
|
replacement => replacement.pageName == originalRegion.page.name);
|
||||||
|
if (!replacementExists) {
|
||||||
|
BlendModeMaterials.ReplacementMaterial replacement = CreateReplacementMaterial(originalRegion, materialTemplate, materialSuffix);
|
||||||
|
if (replacement != null) {
|
||||||
|
replacementMaterials.Add(replacement);
|
||||||
|
anyReplacementMaterialsChanged = true;
|
||||||
|
} else {
|
||||||
|
Debug.LogError(string.Format("Failed creating blend mode Material for SkeletonData asset '{0}'," +
|
||||||
|
" atlas page '{1}', template '{2}'.",
|
||||||
|
skeletonDataAsset.name, originalRegion.page.name, materialTemplate.name),
|
||||||
|
skeletonDataAsset);
|
||||||
|
anyCreationFailed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return anyCreationFailed;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static BlendModeMaterials.ReplacementMaterial CreateReplacementMaterial (
|
||||||
|
AtlasRegion originalRegion, Material materialTemplate, string materialSuffix) {
|
||||||
|
|
||||||
|
BlendModeMaterials.ReplacementMaterial newReplacement = new BlendModeMaterials.ReplacementMaterial();
|
||||||
|
AtlasPage originalPage = originalRegion.page;
|
||||||
|
Material originalMaterial = originalPage.rendererObject as Material;
|
||||||
|
|
||||||
|
newReplacement.pageName = originalPage.name;
|
||||||
|
|
||||||
|
Material blendModeMaterial = new Material(materialTemplate) {
|
||||||
|
name = originalMaterial.name + " " + materialTemplate.name,
|
||||||
|
mainTexture = originalMaterial.mainTexture
|
||||||
|
};
|
||||||
|
newReplacement.material = blendModeMaterial;
|
||||||
|
|
||||||
|
if (newReplacement.material)
|
||||||
|
return newReplacement;
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public void ApplyMaterials (SkeletonData skeletonData) {
|
public void ApplyMaterials (SkeletonData skeletonData) {
|
||||||
if (skeletonData == null) throw new ArgumentNullException("skeletonData");
|
if (skeletonData == null) throw new ArgumentNullException("skeletonData");
|
||||||
if (!requiresBlendModeMaterials)
|
if (!requiresBlendModeMaterials)
|
||||||
|
|||||||
@ -85,7 +85,8 @@ namespace Spine.Unity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a runtime SkeletonDataAsset.</summary>
|
/// Creates a runtime SkeletonDataAsset.
|
||||||
|
/// If you require blend mode materials, call <see cref="SetupRuntimeBlendModeMaterials"/> afterwards.</summary>
|
||||||
public static SkeletonDataAsset CreateRuntimeInstance (TextAsset skeletonDataFile, AtlasAssetBase[] atlasAssets, bool initialize, float scale = 0.01f) {
|
public static SkeletonDataAsset CreateRuntimeInstance (TextAsset skeletonDataFile, AtlasAssetBase[] atlasAssets, bool initialize, float scale = 0.01f) {
|
||||||
SkeletonDataAsset skeletonDataAsset = ScriptableObject.CreateInstance<SkeletonDataAsset>();
|
SkeletonDataAsset skeletonDataAsset = ScriptableObject.CreateInstance<SkeletonDataAsset>();
|
||||||
skeletonDataAsset.Clear();
|
skeletonDataAsset.Clear();
|
||||||
@ -98,6 +99,19 @@ namespace Spine.Unity {
|
|||||||
|
|
||||||
return skeletonDataAsset;
|
return skeletonDataAsset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>If this SkeletonDataAsset has been created via <see cref="CreateRuntimeInstance"/>,
|
||||||
|
/// this method sets up blend mode materials for it.</summary>
|
||||||
|
public void SetupRuntimeBlendModeMaterials (bool applyAdditiveMaterial,
|
||||||
|
BlendModeMaterials.TemplateMaterials templateMaterials) {
|
||||||
|
blendModeMaterials.applyAdditiveMaterial = applyAdditiveMaterial;
|
||||||
|
blendModeMaterials.UpdateBlendmodeMaterialsRequiredState(GetSkeletonData(true));
|
||||||
|
bool anyMaterialsChanged = false;
|
||||||
|
BlendModeMaterials.CreateAndAssignMaterials(this, templateMaterials, ref anyMaterialsChanged);
|
||||||
|
|
||||||
|
Clear();
|
||||||
|
GetSkeletonData(true);
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
/// <summary>Clears the loaded SkeletonData and AnimationStateData. Use this to force a reload for the next time GetSkeletonData is called.</summary>
|
/// <summary>Clears the loaded SkeletonData and AnimationStateData. Use this to force a reload for the next time GetSkeletonData is called.</summary>
|
||||||
|
|||||||
@ -78,10 +78,13 @@ namespace Spine.Unity {
|
|||||||
/// atlas asset JSON file. When procedurally creating textures, each <c>Texture.name</c>
|
/// atlas asset JSON file. When procedurally creating textures, each <c>Texture.name</c>
|
||||||
/// needs to be set to the atlas page texture filename without the .png extension,
|
/// needs to be set to the atlas page texture filename without the .png extension,
|
||||||
/// e.g. 'my_skeleton' if the png filename listed in the atlas asset file is 'my_skeleton.png'.</param>
|
/// e.g. 'my_skeleton' if the png filename listed in the atlas asset file is 'my_skeleton.png'.</param>
|
||||||
|
/// <param name="renameMaterial">If true, newly created materials will be renamed to the atlas texture page name.
|
||||||
|
/// If false, the materials keep the name of the <c>materialPropertySource</c> material they are copied from.</param>
|
||||||
/// <seealso cref="SpineAtlasAsset.CreateRuntimeInstance(TextAsset, Material[], bool, Func{SpineAtlasAsset, TextureLoader})"/>
|
/// <seealso cref="SpineAtlasAsset.CreateRuntimeInstance(TextAsset, Material[], bool, Func{SpineAtlasAsset, TextureLoader})"/>
|
||||||
public static SpineAtlasAsset CreateRuntimeInstance (TextAsset atlasText, Texture2D[] textures,
|
public static SpineAtlasAsset CreateRuntimeInstance (TextAsset atlasText, Texture2D[] textures,
|
||||||
Material materialPropertySource, bool initialize,
|
Material materialPropertySource, bool initialize,
|
||||||
Func<SpineAtlasAsset, TextureLoader> newCustomTextureLoader = null) {
|
Func<SpineAtlasAsset, TextureLoader> newCustomTextureLoader = null,
|
||||||
|
bool renameMaterial = false) {
|
||||||
|
|
||||||
// Get atlas page names.
|
// Get atlas page names.
|
||||||
string atlasString = atlasText.text;
|
string atlasString = atlasText.text;
|
||||||
@ -106,6 +109,8 @@ namespace Spine.Unity {
|
|||||||
// Match found.
|
// Match found.
|
||||||
mat = new Material(materialPropertySource);
|
mat = new Material(materialPropertySource);
|
||||||
mat.mainTexture = textures[j];
|
mat.mainTexture = textures[j];
|
||||||
|
if (renameMaterial)
|
||||||
|
mat.name = pageName;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"name": "com.esotericsoftware.spine.spine-unity",
|
"name": "com.esotericsoftware.spine.spine-unity",
|
||||||
"displayName": "spine-unity Runtime",
|
"displayName": "spine-unity Runtime",
|
||||||
"description": "This plugin provides the spine-unity runtime core.",
|
"description": "This plugin provides the spine-unity runtime core.",
|
||||||
"version": "4.2.67",
|
"version": "4.2.68",
|
||||||
"unity": "2018.3",
|
"unity": "2018.3",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Esoteric Software",
|
"name": "Esoteric Software",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user