From 28afb58a993d851b8deb750ea42a591333d698c5 Mon Sep 17 00:00:00 2001 From: marcin Date: Mon, 28 Apr 2025 14:33:04 +0200 Subject: [PATCH] improved barkplayer - now can play multiple sequences in queue --- Assets/Dialogue/TestDialogueBase.asset | 597 +++++++ Assets/Scenes/Marcin/DebugScene.unity | 2028 ++++++++++++------------ Assets/Scripts/Utils/BarkPlayer.cs | 570 +++++-- 3 files changed, 2022 insertions(+), 1173 deletions(-) diff --git a/Assets/Dialogue/TestDialogueBase.asset b/Assets/Dialogue/TestDialogueBase.asset index 5c4f7eb39..00e6d006d 100644 --- a/Assets/Dialogue/TestDialogueBase.asset +++ b/Assets/Dialogue/TestDialogueBase.asset @@ -232,6 +232,28 @@ MonoBehaviour: spritePortrait: {fileID: 0} alternatePortraits: [] spritePortraits: [] + - id: 10 + fields: + - title: Name + value: Begger + type: 0 + typeString: CustomFieldType_Text + - title: Pictures + value: '[]' + type: 3 + typeString: CustomFieldType_Files + - title: Description + value: + type: 0 + typeString: CustomFieldType_Text + - title: IsPlayer + value: False + type: 2 + typeString: CustomFieldType_Boolean + portrait: {fileID: 0} + spritePortrait: {fileID: 0} + alternatePortraits: [] + spritePortraits: [] items: - id: 14 fields: @@ -23782,6 +23804,581 @@ MonoBehaviour: height: 30 canvasScrollPosition: {x: 0, y: 0} canvasZoom: 1 + - id: 96 + fields: + - title: Title + value: CH02/RUINEDTOWN/BeggerDialogue + type: 0 + typeString: CustomFieldType_Text + - title: Pictures + value: '[]' + type: 3 + typeString: CustomFieldType_Files + - title: Description + value: + type: 0 + typeString: CustomFieldType_Text + - title: Actor + value: 1 + type: 5 + typeString: CustomFieldType_Actor + - title: Conversant + value: 2 + type: 5 + typeString: CustomFieldType_Actor + overrideSettings: + useOverrides: 0 + overrideSubtitleSettings: 0 + showNPCSubtitlesDuringLine: 1 + showNPCSubtitlesWithResponses: 1 + showPCSubtitlesDuringLine: 0 + skipPCSubtitleAfterResponseMenu: 0 + subtitleCharsPerSecond: 30 + minSubtitleSeconds: 2 + continueButton: 0 + overrideSequenceSettings: 0 + defaultSequence: + defaultPlayerSequence: + defaultResponseMenuSequence: + overrideInputSettings: 0 + alwaysForceResponseMenu: 1 + includeInvalidEntries: 0 + responseTimeout: 0 + cancelSubtitle: + key: 27 + buttonName: + cancelConversation: + key: 27 + buttonName: + nodeColor: + dialogueEntries: + - id: 0 + fields: + - title: Title + value: START + type: 0 + typeString: + - title: Pictures + value: '[]' + type: 3 + typeString: CustomFieldType_Files + - title: Description + value: + type: 0 + typeString: + - title: Actor + value: 1 + type: 5 + typeString: CustomFieldType_Actor + - title: Conversant + value: 2 + type: 5 + typeString: CustomFieldType_Actor + - title: Menu Text + value: + type: 0 + typeString: + - title: Dialogue Text + value: + type: 0 + typeString: + - title: Parenthetical + value: + type: 0 + typeString: + - title: Audio Files + value: '[]' + type: 3 + typeString: CustomFieldType_Files + - title: Video File + value: + type: 0 + typeString: + - title: Sequence + value: None() + type: 0 + typeString: + - title: pl + value: + type: 4 + typeString: CustomFieldType_Localization + conversationID: 96 + isRoot: 0 + isGroup: 0 + nodeColor: + delaySimStatus: 0 + falseConditionAction: + conditionPriority: 2 + outgoingLinks: + - originConversationID: 96 + originDialogueID: 0 + destinationConversationID: 96 + destinationDialogueID: 1 + isConnector: 0 + priority: 2 + conditionsString: + userScript: + onExecute: + m_PersistentCalls: + m_Calls: [] + canvasRect: + serializedVersion: 2 + x: 20 + y: 30 + width: 160 + height: 30 + - id: 1 + fields: + - title: Title + value: + type: 0 + typeString: CustomFieldType_Text + - title: Pictures + value: '[]' + type: 3 + typeString: CustomFieldType_Files + - title: Description + value: + type: 0 + typeString: CustomFieldType_Text + - title: Actor + value: 10 + type: 5 + typeString: CustomFieldType_Actor + - title: Conversant + value: 1 + type: 5 + typeString: CustomFieldType_Actor + - title: Menu Text + value: + type: 0 + typeString: CustomFieldType_Text + - title: Dialogue Text + value: Mhm... Another lost soul wanders through the streets of Ancaran in + search of hope... + type: 0 + typeString: CustomFieldType_Text + - title: Parenthetical + value: + type: 0 + typeString: CustomFieldType_Text + - title: Audio Files + value: '[]' + type: 3 + typeString: CustomFieldType_Files + - title: Video File + value: + type: 0 + typeString: CustomFieldType_Text + - title: Sequence + value: + type: 0 + typeString: CustomFieldType_Text + - title: pl + value: + type: 4 + typeString: CustomFieldType_Localization + conversationID: 96 + isRoot: 0 + isGroup: 0 + nodeColor: + delaySimStatus: 0 + falseConditionAction: Block + conditionPriority: 2 + outgoingLinks: + - originConversationID: 96 + originDialogueID: 1 + destinationConversationID: 96 + destinationDialogueID: 2 + isConnector: 0 + priority: 2 + conditionsString: + userScript: + onExecute: + m_PersistentCalls: + m_Calls: [] + canvasRect: + serializedVersion: 2 + x: 19 + y: 87 + width: 160 + height: 30 + - id: 2 + fields: + - title: Title + value: + type: 0 + typeString: CustomFieldType_Text + - title: Pictures + value: '[]' + type: 3 + typeString: CustomFieldType_Files + - title: Description + value: + type: 0 + typeString: CustomFieldType_Text + - title: Actor + value: 1 + type: 5 + typeString: CustomFieldType_Actor + - title: Conversant + value: 10 + type: 5 + typeString: CustomFieldType_Actor + - title: Menu Text + value: + type: 0 + typeString: CustomFieldType_Text + - title: Dialogue Text + value: Hail, old man. + type: 0 + typeString: CustomFieldType_Text + - title: Parenthetical + value: + type: 0 + typeString: CustomFieldType_Text + - title: Audio Files + value: '[]' + type: 3 + typeString: CustomFieldType_Files + - title: Video File + value: + type: 0 + typeString: CustomFieldType_Text + - title: Sequence + value: + type: 0 + typeString: CustomFieldType_Text + - title: pl + value: + type: 4 + typeString: CustomFieldType_Localization + conversationID: 96 + isRoot: 0 + isGroup: 0 + nodeColor: + delaySimStatus: 0 + falseConditionAction: Block + conditionPriority: 2 + outgoingLinks: + - originConversationID: 96 + originDialogueID: 2 + destinationConversationID: 96 + destinationDialogueID: 3 + isConnector: 0 + priority: 2 + conditionsString: + userScript: + onExecute: + m_PersistentCalls: + m_Calls: [] + canvasRect: + serializedVersion: 2 + x: 19 + y: 130 + width: 160 + height: 30 + - id: 3 + fields: + - title: Title + value: + type: 0 + typeString: CustomFieldType_Text + - title: Pictures + value: '[]' + type: 3 + typeString: CustomFieldType_Files + - title: Description + value: + type: 0 + typeString: CustomFieldType_Text + - title: Actor + value: 10 + type: 5 + typeString: CustomFieldType_Actor + - title: Conversant + value: 1 + type: 5 + typeString: CustomFieldType_Actor + - title: Menu Text + value: + type: 0 + typeString: CustomFieldType_Text + - title: Dialogue Text + value: Another fool...! There is no hope in Ancaran! Nor anywhere else. We + were all betrayed. Abandoned. + type: 0 + typeString: CustomFieldType_Text + - title: Parenthetical + value: + type: 0 + typeString: CustomFieldType_Text + - title: Audio Files + value: '[]' + type: 3 + typeString: CustomFieldType_Files + - title: Video File + value: + type: 0 + typeString: CustomFieldType_Text + - title: Sequence + value: + type: 0 + typeString: CustomFieldType_Text + - title: pl + value: + type: 4 + typeString: CustomFieldType_Localization + conversationID: 96 + isRoot: 0 + isGroup: 0 + nodeColor: + delaySimStatus: 0 + falseConditionAction: Block + conditionPriority: 2 + outgoingLinks: + - originConversationID: 96 + originDialogueID: 3 + destinationConversationID: 96 + destinationDialogueID: 4 + isConnector: 0 + priority: 2 + conditionsString: + userScript: + onExecute: + m_PersistentCalls: + m_Calls: [] + canvasRect: + serializedVersion: 2 + x: 19 + y: 180 + width: 160 + height: 30 + - id: 4 + fields: + - title: Title + value: + type: 0 + typeString: CustomFieldType_Text + - title: Pictures + value: '[]' + type: 3 + typeString: CustomFieldType_Files + - title: Description + value: + type: 0 + typeString: CustomFieldType_Text + - title: Actor + value: 1 + type: 5 + typeString: CustomFieldType_Actor + - title: Conversant + value: 10 + type: 5 + typeString: CustomFieldType_Actor + - title: Menu Text + value: + type: 0 + typeString: CustomFieldType_Text + - title: Dialogue Text + value: Who betrayed you? + type: 0 + typeString: CustomFieldType_Text + - title: Parenthetical + value: + type: 0 + typeString: CustomFieldType_Text + - title: Audio Files + value: '[]' + type: 3 + typeString: CustomFieldType_Files + - title: Video File + value: + type: 0 + typeString: CustomFieldType_Text + - title: Sequence + value: + type: 0 + typeString: CustomFieldType_Text + - title: pl + value: + type: 4 + typeString: CustomFieldType_Localization + conversationID: 96 + isRoot: 0 + isGroup: 0 + nodeColor: + delaySimStatus: 0 + falseConditionAction: Block + conditionPriority: 2 + outgoingLinks: + - originConversationID: 96 + originDialogueID: 4 + destinationConversationID: 96 + destinationDialogueID: 5 + isConnector: 0 + priority: 2 + conditionsString: + userScript: + onExecute: + m_PersistentCalls: + m_Calls: [] + canvasRect: + serializedVersion: 2 + x: 19 + y: 230 + width: 160 + height: 30 + - id: 5 + fields: + - title: Title + value: + type: 0 + typeString: CustomFieldType_Text + - title: Pictures + value: '[]' + type: 3 + typeString: CustomFieldType_Files + - title: Description + value: + type: 0 + typeString: CustomFieldType_Text + - title: Actor + value: 10 + type: 5 + typeString: CustomFieldType_Actor + - title: Conversant + value: 1 + type: 5 + typeString: CustomFieldType_Actor + - title: Menu Text + value: + type: 0 + typeString: CustomFieldType_Text + - title: Dialogue Text + value: Oh, the sun, and the dust, and the shadows... All is done now... + type: 0 + typeString: CustomFieldType_Text + - title: Parenthetical + value: + type: 0 + typeString: CustomFieldType_Text + - title: Audio Files + value: '[]' + type: 3 + typeString: CustomFieldType_Files + - title: Video File + value: + type: 0 + typeString: CustomFieldType_Text + - title: Sequence + value: + type: 0 + typeString: CustomFieldType_Text + - title: pl + value: + type: 4 + typeString: CustomFieldType_Localization + conversationID: 96 + isRoot: 0 + isGroup: 0 + nodeColor: + delaySimStatus: 0 + falseConditionAction: Block + conditionPriority: 2 + outgoingLinks: + - originConversationID: 96 + originDialogueID: 5 + destinationConversationID: 96 + destinationDialogueID: 6 + isConnector: 0 + priority: 2 + conditionsString: + userScript: + onExecute: + m_PersistentCalls: + m_Calls: [] + canvasRect: + serializedVersion: 2 + x: 19 + y: 280 + width: 160 + height: 30 + - id: 6 + fields: + - title: Title + value: + type: 0 + typeString: CustomFieldType_Text + - title: Pictures + value: '[]' + type: 3 + typeString: CustomFieldType_Files + - title: Description + value: + type: 0 + typeString: CustomFieldType_Text + - title: Actor + value: 1 + type: 5 + typeString: CustomFieldType_Actor + - title: Conversant + value: 10 + type: 5 + typeString: CustomFieldType_Actor + - title: Menu Text + value: + type: 0 + typeString: CustomFieldType_Text + - title: Dialogue Text + value: Nothing but a ranting lunatic. + type: 0 + typeString: CustomFieldType_Text + - title: Parenthetical + value: + type: 0 + typeString: CustomFieldType_Text + - title: Audio Files + value: '[]' + type: 3 + typeString: CustomFieldType_Files + - title: Video File + value: + type: 0 + typeString: CustomFieldType_Text + - title: Sequence + value: + type: 0 + typeString: CustomFieldType_Text + - title: pl + value: + type: 4 + typeString: CustomFieldType_Localization + - title: EventGuid + value: b6b6048b-ca0a-41eb-997f-2fd9796542ae + type: 0 + typeString: + conversationID: 96 + isRoot: 0 + isGroup: 0 + nodeColor: + delaySimStatus: 0 + falseConditionAction: Block + conditionPriority: 2 + outgoingLinks: [] + conditionsString: + userScript: + onExecute: + m_PersistentCalls: + m_Calls: [] + canvasRect: + serializedVersion: 2 + x: 19 + y: 330 + width: 160 + height: 30 + canvasScrollPosition: {x: 0, y: 0} + canvasZoom: 1 syncInfo: syncActors: 0 syncItems: 0 diff --git a/Assets/Scenes/Marcin/DebugScene.unity b/Assets/Scenes/Marcin/DebugScene.unity index dde8f1aa3..e642fda98 100644 --- a/Assets/Scenes/Marcin/DebugScene.unity +++ b/Assets/Scenes/Marcin/DebugScene.unity @@ -4325,6 +4325,43 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 9ac95f22970d95c45a231271b24ffc73, type: 3} +--- !u!84 &146960043 +RenderTexture: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_ImageContentsHash: + serializedVersion: 2 + Hash: 00000000000000000000000000000000 + m_IsAlphaChannelOptional: 0 + serializedVersion: 6 + m_Width: 512 + m_Height: 512 + m_AntiAliasing: 1 + m_MipCount: -1 + m_DepthStencilFormat: 90 + m_ColorFormat: 4 + m_MipMap: 0 + m_GenerateMips: 1 + m_SRGB: 1 + m_UseDynamicScale: 0 + m_UseDynamicScaleExplicit: 0 + m_BindMS: 0 + m_EnableCompatibleFormat: 1 + m_EnableRandomWrite: 0 + m_TextureSettings: + serializedVersion: 2 + m_FilterMode: 1 + m_Aniso: 1 + m_MipBias: 0 + m_WrapU: 1 + m_WrapV: 1 + m_WrapW: 1 + m_Dimension: 2 + m_VolumeDepth: 1 + m_ShadowSamplingMode: 2 --- !u!1 &156773212 GameObject: m_ObjectHideFlags: 0 @@ -4610,171 +4647,6 @@ Animator: type: 3} m_PrefabInstance: {fileID: 44831531} m_PrefabAsset: {fileID: 0} ---- !u!43 &247765714 -Mesh: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: FluidContainer - serializedVersion: 11 - m_SubMeshes: - - serializedVersion: 2 - firstByte: 0 - indexCount: 36 - topology: 0 - baseVertex: 0 - firstVertex: 0 - vertexCount: 24 - localAABB: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 10, y: 10, z: 9} - m_Shapes: - vertices: [] - shapes: [] - channels: [] - fullWeights: [] - m_BindPose: [] - m_BoneNameHashes: - m_RootBoneNameHash: 0 - m_BonesAABB: [] - m_VariableBoneCountWeights: - m_Data: - m_MeshCompression: 0 - m_IsReadable: 1 - m_KeepVertices: 0 - m_KeepIndices: 0 - m_IndexFormat: 1 - m_IndexBuffer: 00000000010000000300000001000000020000000300000004000000050000000700000005000000060000000700000008000000090000000b000000090000000a0000000b0000000c0000000d0000000f0000000d0000000e0000000f000000100000001100000013000000110000001200000013000000140000001500000017000000150000001600000017000000 - m_VertexData: - serializedVersion: 3 - m_VertexCount: 24 - m_Channels: - - stream: 0 - offset: 0 - format: 0 - dimension: 3 - - stream: 0 - offset: 12 - format: 0 - dimension: 3 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 24 - format: 0 - dimension: 2 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - m_DataSize: 768 - _typelessdata: 000020c1000020c100001041000000800000803f000000800000803f0000803f00002041000020c100001041000000800000803f00000080000000000000803f00002041000020c1000010c1000000800000803f000000800000000000000000000020c1000020c1000010c1000000800000803f000000800000803f00000000000020c100002041000010c10000803f00000080000000800000803f0000803f000020c100002041000010410000803f0000008000000080000000000000803f000020c1000020c1000010410000803f00000080000000800000000000000000000020c1000020c1000010c10000803f00000080000000800000803f00000000000020c100002041000010410000008000000080000080bf0000803f0000803f0000204100002041000010410000008000000080000080bf000000000000803f00002041000020c1000010410000008000000080000080bf0000000000000000000020c1000020c1000010410000008000000080000080bf0000803f000000000000204100002041000010c100000080000000800000803f0000803f0000803f000020c100002041000010c100000080000000800000803f000000000000803f000020c1000020c1000010c100000080000000800000803f000000000000000000002041000020c1000010c100000080000000800000803f0000803f00000000000020410000204100001041000080bf00000080000000800000803f0000803f0000204100002041000010c1000080bf0000008000000080000000000000803f00002041000020c1000010c1000080bf0000008000000080000000000000000000002041000020c100001041000080bf00000080000000800000803f00000000000020c100002041000010c100000080000080bf000000800000803f0000803f0000204100002041000010c100000080000080bf00000080000000000000803f00002041000020410000104100000080000080bf000000800000000000000000000020c1000020410000104100000080000080bf000000800000803f00000000 - m_CompressedMesh: - m_Vertices: - m_NumItems: 0 - m_Range: 0 - m_Start: 0 - m_Data: - m_BitSize: 0 - m_UV: - m_NumItems: 0 - m_Range: 0 - m_Start: 0 - m_Data: - m_BitSize: 0 - m_Normals: - m_NumItems: 0 - m_Range: 0 - m_Start: 0 - m_Data: - m_BitSize: 0 - m_Tangents: - m_NumItems: 0 - m_Range: 0 - m_Start: 0 - m_Data: - m_BitSize: 0 - m_Weights: - m_NumItems: 0 - m_Data: - m_BitSize: 0 - m_NormalSigns: - m_NumItems: 0 - m_Data: - m_BitSize: 0 - m_TangentSigns: - m_NumItems: 0 - m_Data: - m_BitSize: 0 - m_FloatColors: - m_NumItems: 0 - m_Range: 0 - m_Start: 0 - m_Data: - m_BitSize: 0 - m_BoneIndices: - m_NumItems: 0 - m_Data: - m_BitSize: 0 - m_Triangles: - m_NumItems: 0 - m_Data: - m_BitSize: 0 - m_UVInfo: 0 - m_LocalAABB: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 10, y: 10, z: 9} - m_MeshUsageFlags: 0 - m_CookingOptions: 30 - m_BakedConvexCollisionMesh: - m_BakedTriangleCollisionMesh: - 'm_MeshMetrics[0]': 1 - 'm_MeshMetrics[1]': 1 - m_MeshOptimizationFlags: 1 - m_StreamData: - serializedVersion: 2 - offset: 0 - size: 0 - path: --- !u!1 &267127504 GameObject: m_ObjectHideFlags: 0 @@ -6671,132 +6543,6 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} ---- !u!21 &581163593 -Material: - serializedVersion: 8 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: PortalMat (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) - (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) - (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) - (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) - (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) - (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) - (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) - (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) - (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) - (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) - (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) - m_Shader: {fileID: -6465566751694194690, guid: f90138ae641de784cb4b453bdc734b14, - type: 3} - m_Parent: {fileID: 0} - m_ModifiedSerializedProperties: 0 - m_ValidKeywords: [] - m_InvalidKeywords: [] - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: - - MOTIONVECTORS - m_LockedProperties: - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _BaseMap: - m_Texture: {fileID: 717149104} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _BumpMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _EmissionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MaskMap: - m_Texture: {fileID: 2800000, guid: 84487d73ca4b791498332d8f6858417f, type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MetallicGlossMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _NormalMap: - m_Texture: {fileID: 2800000, guid: 9d67afb2ebc87cc43b5be99e1b689960, type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _OcclusionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _SpecGlossMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _Texture2DAsset_EAC75755_Out_0: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_Lightmaps: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_LightmapsInd: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_ShadowMasks: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Ints: [] - m_Floats: - - _AlphaClip: 0 - - _Blend: 0 - - _BumpScale: 1 - - _Cull: 2 - - _Cutoff: 0.5 - - _DstBlend: 0 - - _EnvironmentReflections: 1 - - _GlossMapScale: 0 - - _Glossiness: 0 - - _GlossyReflections: 0 - - _Metallic: 0 - - _NormalSpeed: 0.36 - - _NormalStrength: 0.49 - - _NormalTiling: 0.41 - - _OcclusionStrength: 1 - - _OffsetStrength: 0.1 - - _PortalBrightness: 2 - - _QueueControl: 0 - - _QueueOffset: 0 - - _ReceiveShadows: 1 - - _Smoothness: 0.5 - - _SmoothnessTextureChannel: 0 - - _SpecularHighlights: 1 - - _Speed: 0.5 - - _SrcBlend: 1 - - _Surface: 0 - - _TwirlPower: 8 - - _WorkflowMode: 1 - - _ZWrite: 1 - m_Colors: - - _BaseColor: {r: 1, g: 1, b: 1, a: 1} - - _Color: {r: 1, g: 1, b: 1, a: 1} - - _EffectColor: {r: 0, g: 0.7548079, b: 1, a: 0} - - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} - m_BuildTextureStacks: [] - m_AllowLocking: 1 --- !u!1001 &587047411 PrefabInstance: m_ObjectHideFlags: 0 @@ -6939,6 +6685,11 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: + - target: {fileID: 2653291803493402411, guid: 1151ce019ed40404caaaeaa301fb2b49, + type: 3} + propertyPath: conversation + value: CH02/RUINEDTOWN/BeggerDialogue + objectReference: {fileID: 0} - target: {fileID: 2653291803493402411, guid: 1151ce019ed40404caaaeaa301fb2b49, type: 3} propertyPath: onExecute.m_PersistentCalls.m_Calls.Array.size @@ -7060,43 +6811,179 @@ MonoBehaviour: m_EditorClassIdentifier: timeScale: 1 startFixedDeltaTime: 0 ---- !u!84 &717149104 -RenderTexture: +--- !u!43 &717947434 +Mesh: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: - m_ImageContentsHash: + m_Name: Quad Instance Instance Instance Instance Instance Instance Instance Instance + Instance Instance Instance Instance Instance Instance Instance Instance Instance + Instance Instance Instance Instance Instance Instance Instance Instance Instance + Instance Instance Instance Instance Instance Instance Instance Instance Instance + Instance Instance Instance Instance Instance Instance Instance Instance Instance + Instance Instance Instance Instance Instance Instance Instance Instance Instance + Instance Instance Instance Instance Instance Instance Instance Instance Instance + Instance Instance Instance Instance Instance Instance Instance Instance Instance + Instance Instance Instance Instance Instance Instance Instance Instance Instance + serializedVersion: 11 + m_SubMeshes: + - serializedVersion: 2 + firstByte: 0 + indexCount: 6 + topology: 0 + baseVertex: 0 + firstVertex: 0 + vertexCount: 4 + localAABB: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0.5, y: 0.5, z: 3.0616168e-17} + m_Shapes: + vertices: [] + shapes: [] + channels: [] + fullWeights: [] + m_BindPose: [] + m_BoneNameHashes: + m_RootBoneNameHash: 0 + m_BonesAABB: [] + m_VariableBoneCountWeights: + m_Data: + m_MeshCompression: 0 + m_IsReadable: 1 + m_KeepVertices: 1 + m_KeepIndices: 1 + m_IndexFormat: 0 + m_IndexBuffer: 000003000100030000000200 + m_VertexData: + serializedVersion: 3 + m_VertexCount: 4 + m_Channels: + - stream: 0 + offset: 0 + format: 0 + dimension: 3 + - stream: 0 + offset: 12 + format: 0 + dimension: 3 + - stream: 0 + offset: 24 + format: 0 + dimension: 4 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 40 + format: 0 + dimension: 2 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + m_DataSize: 192 + _typelessdata: 000000bf000000bf31310da40000000000000000000080bf0000803f0000000000000000000080bf00000000000000000000003f000000bf31310da40000000000000000000080bf0000803f0000000000000000000080bf0000803f00000000000000bf0000003f31310d240000000000000000000080bf0000803f0000000000000000000080bf000000000000803f0000003f0000003f31310d240000000000000000000080bf0000803f0000000000000000000080bf0000803f0000803f + m_CompressedMesh: + m_Vertices: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_UV: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_Normals: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_Tangents: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_Weights: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_NormalSigns: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_TangentSigns: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_FloatColors: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_BoneIndices: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_Triangles: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_UVInfo: 0 + m_LocalAABB: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0.5, y: 0.5, z: 3.0616168e-17} + m_MeshUsageFlags: 0 + m_CookingOptions: 30 + m_BakedConvexCollisionMesh: + m_BakedTriangleCollisionMesh: + 'm_MeshMetrics[0]': 1 + 'm_MeshMetrics[1]': 1 + m_MeshOptimizationFlags: 0 + m_StreamData: serializedVersion: 2 - Hash: 00000000000000000000000000000000 - m_IsAlphaChannelOptional: 0 - serializedVersion: 6 - m_Width: 512 - m_Height: 512 - m_AntiAliasing: 1 - m_MipCount: -1 - m_DepthStencilFormat: 90 - m_ColorFormat: 4 - m_MipMap: 0 - m_GenerateMips: 1 - m_SRGB: 1 - m_UseDynamicScale: 0 - m_UseDynamicScaleExplicit: 0 - m_BindMS: 0 - m_EnableCompatibleFormat: 1 - m_EnableRandomWrite: 0 - m_TextureSettings: - serializedVersion: 2 - m_FilterMode: 1 - m_Aniso: 1 - m_MipBias: 0 - m_WrapU: 1 - m_WrapV: 1 - m_WrapW: 1 - m_Dimension: 2 - m_VolumeDepth: 1 - m_ShadowSamplingMode: 2 + offset: 0 + size: 0 + path: --- !u!1001 &775315289 PrefabInstance: m_ObjectHideFlags: 0 @@ -7661,6 +7548,133 @@ Transform: - {fileID: 236024686} m_Father: {fileID: 421160340} m_LocalEulerAnglesHint: {x: -7.484, y: 158.964, z: 2.621} +--- !u!21 &828867995 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: PortalMat (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) + (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) + (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) + (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) + (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) + (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) + (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) + (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) + (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) + (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) + (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) + (Instance) (Instance) (Instance) (Instance) + m_Shader: {fileID: -6465566751694194690, guid: f90138ae641de784cb4b453bdc734b14, + type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseMap: + m_Texture: {fileID: 146960043} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskMap: + m_Texture: {fileID: 2800000, guid: 84487d73ca4b791498332d8f6858417f, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMap: + m_Texture: {fileID: 2800000, guid: 9d67afb2ebc87cc43b5be99e1b689960, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Texture2DAsset_EAC75755_Out_0: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AlphaClip: 0 + - _Blend: 0 + - _BumpScale: 1 + - _Cull: 2 + - _Cutoff: 0.5 + - _DstBlend: 0 + - _EnvironmentReflections: 1 + - _GlossMapScale: 0 + - _Glossiness: 0 + - _GlossyReflections: 0 + - _Metallic: 0 + - _NormalSpeed: 0.36 + - _NormalStrength: 0.49 + - _NormalTiling: 0.41 + - _OcclusionStrength: 1 + - _OffsetStrength: 0.1 + - _PortalBrightness: 2 + - _QueueControl: 0 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _Smoothness: 0.5 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _Speed: 0.5 + - _SrcBlend: 1 + - _Surface: 0 + - _TwirlPower: 8 + - _WorkflowMode: 1 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EffectColor: {r: 0, g: 0.7548079, b: 1, a: 0} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} + m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!1001 &829254892 PrefabInstance: m_ObjectHideFlags: 0 @@ -7804,7 +7818,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 1959370663} + - {fileID: 1437978290} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -7833,7 +7847,7 @@ MeshFilter: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 885468786} - m_Mesh: {fileID: 1287816488} + m_Mesh: {fileID: 1999385387} --- !u!4 &885468790 Transform: m_ObjectHideFlags: 0 @@ -11593,171 +11607,6 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: b52fce9a517ed1142bb8edef5301445b, type: 3} ---- !u!43 &1188045365 -Mesh: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: FluidContainer - serializedVersion: 11 - m_SubMeshes: - - serializedVersion: 2 - firstByte: 0 - indexCount: 36 - topology: 0 - baseVertex: 0 - firstVertex: 0 - vertexCount: 24 - localAABB: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 10, y: 10, z: 9} - m_Shapes: - vertices: [] - shapes: [] - channels: [] - fullWeights: [] - m_BindPose: [] - m_BoneNameHashes: - m_RootBoneNameHash: 0 - m_BonesAABB: [] - m_VariableBoneCountWeights: - m_Data: - m_MeshCompression: 0 - m_IsReadable: 1 - m_KeepVertices: 0 - m_KeepIndices: 0 - m_IndexFormat: 1 - m_IndexBuffer: 00000000010000000300000001000000020000000300000004000000050000000700000005000000060000000700000008000000090000000b000000090000000a0000000b0000000c0000000d0000000f0000000d0000000e0000000f000000100000001100000013000000110000001200000013000000140000001500000017000000150000001600000017000000 - m_VertexData: - serializedVersion: 3 - m_VertexCount: 24 - m_Channels: - - stream: 0 - offset: 0 - format: 0 - dimension: 3 - - stream: 0 - offset: 12 - format: 0 - dimension: 3 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 24 - format: 0 - dimension: 2 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - m_DataSize: 768 - _typelessdata: 000020c1000020c100001041000000800000803f000000800000803f0000803f00002041000020c100001041000000800000803f00000080000000000000803f00002041000020c1000010c1000000800000803f000000800000000000000000000020c1000020c1000010c1000000800000803f000000800000803f00000000000020c100002041000010c10000803f00000080000000800000803f0000803f000020c100002041000010410000803f0000008000000080000000000000803f000020c1000020c1000010410000803f00000080000000800000000000000000000020c1000020c1000010c10000803f00000080000000800000803f00000000000020c100002041000010410000008000000080000080bf0000803f0000803f0000204100002041000010410000008000000080000080bf000000000000803f00002041000020c1000010410000008000000080000080bf0000000000000000000020c1000020c1000010410000008000000080000080bf0000803f000000000000204100002041000010c100000080000000800000803f0000803f0000803f000020c100002041000010c100000080000000800000803f000000000000803f000020c1000020c1000010c100000080000000800000803f000000000000000000002041000020c1000010c100000080000000800000803f0000803f00000000000020410000204100001041000080bf00000080000000800000803f0000803f0000204100002041000010c1000080bf0000008000000080000000000000803f00002041000020c1000010c1000080bf0000008000000080000000000000000000002041000020c100001041000080bf00000080000000800000803f00000000000020c100002041000010c100000080000080bf000000800000803f0000803f0000204100002041000010c100000080000080bf00000080000000000000803f00002041000020410000104100000080000080bf000000800000000000000000000020c1000020410000104100000080000080bf000000800000803f00000000 - m_CompressedMesh: - m_Vertices: - m_NumItems: 0 - m_Range: 0 - m_Start: 0 - m_Data: - m_BitSize: 0 - m_UV: - m_NumItems: 0 - m_Range: 0 - m_Start: 0 - m_Data: - m_BitSize: 0 - m_Normals: - m_NumItems: 0 - m_Range: 0 - m_Start: 0 - m_Data: - m_BitSize: 0 - m_Tangents: - m_NumItems: 0 - m_Range: 0 - m_Start: 0 - m_Data: - m_BitSize: 0 - m_Weights: - m_NumItems: 0 - m_Data: - m_BitSize: 0 - m_NormalSigns: - m_NumItems: 0 - m_Data: - m_BitSize: 0 - m_TangentSigns: - m_NumItems: 0 - m_Data: - m_BitSize: 0 - m_FloatColors: - m_NumItems: 0 - m_Range: 0 - m_Start: 0 - m_Data: - m_BitSize: 0 - m_BoneIndices: - m_NumItems: 0 - m_Data: - m_BitSize: 0 - m_Triangles: - m_NumItems: 0 - m_Data: - m_BitSize: 0 - m_UVInfo: 0 - m_LocalAABB: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 10, y: 10, z: 9} - m_MeshUsageFlags: 0 - m_CookingOptions: 30 - m_BakedConvexCollisionMesh: - m_BakedTriangleCollisionMesh: - 'm_MeshMetrics[0]': 1 - 'm_MeshMetrics[1]': 1 - m_MeshOptimizationFlags: 1 - m_StreamData: - serializedVersion: 2 - offset: 0 - size: 0 - path: --- !u!21 &1192932572 Material: serializedVersion: 8 @@ -12034,7 +11883,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 581163593} + - {fileID: 828867995} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -12063,180 +11912,7 @@ MeshFilter: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1272116024} - m_Mesh: {fileID: 2120007422} ---- !u!43 &1287816488 -Mesh: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Quad Instance Instance Instance Instance Instance Instance Instance Instance - Instance Instance Instance Instance Instance Instance Instance Instance Instance - Instance Instance Instance Instance Instance Instance Instance Instance Instance - Instance Instance Instance Instance Instance Instance Instance Instance Instance - Instance Instance Instance Instance Instance Instance Instance Instance Instance - Instance Instance Instance Instance Instance Instance Instance Instance Instance - Instance Instance Instance Instance Instance Instance Instance Instance Instance - Instance Instance Instance Instance Instance Instance Instance Instance Instance - Instance Instance Instance - serializedVersion: 11 - m_SubMeshes: - - serializedVersion: 2 - firstByte: 0 - indexCount: 6 - topology: 0 - baseVertex: 0 - firstVertex: 0 - vertexCount: 4 - localAABB: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0.5, y: 0.5, z: 3.0616168e-17} - m_Shapes: - vertices: [] - shapes: [] - channels: [] - fullWeights: [] - m_BindPose: [] - m_BoneNameHashes: - m_RootBoneNameHash: 0 - m_BonesAABB: [] - m_VariableBoneCountWeights: - m_Data: - m_MeshCompression: 0 - m_IsReadable: 1 - m_KeepVertices: 1 - m_KeepIndices: 1 - m_IndexFormat: 0 - m_IndexBuffer: 000003000100030000000200 - m_VertexData: - serializedVersion: 3 - m_VertexCount: 4 - m_Channels: - - stream: 0 - offset: 0 - format: 0 - dimension: 3 - - stream: 0 - offset: 12 - format: 0 - dimension: 3 - - stream: 0 - offset: 24 - format: 0 - dimension: 4 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 40 - format: 0 - dimension: 2 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - m_DataSize: 192 - _typelessdata: 000000bf000000bf31310da40000000000000000000080bf0000803f0000000000000000000080bf00000000000000000000003f000000bf31310da40000000000000000000080bf0000803f0000000000000000000080bf0000803f00000000000000bf0000003f31310d240000000000000000000080bf0000803f0000000000000000000080bf000000000000803f0000003f0000003f31310d240000000000000000000080bf0000803f0000000000000000000080bf0000803f0000803f - m_CompressedMesh: - m_Vertices: - m_NumItems: 0 - m_Range: 0 - m_Start: 0 - m_Data: - m_BitSize: 0 - m_UV: - m_NumItems: 0 - m_Range: 0 - m_Start: 0 - m_Data: - m_BitSize: 0 - m_Normals: - m_NumItems: 0 - m_Range: 0 - m_Start: 0 - m_Data: - m_BitSize: 0 - m_Tangents: - m_NumItems: 0 - m_Range: 0 - m_Start: 0 - m_Data: - m_BitSize: 0 - m_Weights: - m_NumItems: 0 - m_Data: - m_BitSize: 0 - m_NormalSigns: - m_NumItems: 0 - m_Data: - m_BitSize: 0 - m_TangentSigns: - m_NumItems: 0 - m_Data: - m_BitSize: 0 - m_FloatColors: - m_NumItems: 0 - m_Range: 0 - m_Start: 0 - m_Data: - m_BitSize: 0 - m_BoneIndices: - m_NumItems: 0 - m_Data: - m_BitSize: 0 - m_Triangles: - m_NumItems: 0 - m_Data: - m_BitSize: 0 - m_UVInfo: 0 - m_LocalAABB: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0.5, y: 0.5, z: 3.0616168e-17} - m_MeshUsageFlags: 0 - m_CookingOptions: 30 - m_BakedConvexCollisionMesh: - m_BakedTriangleCollisionMesh: - 'm_MeshMetrics[0]': 1 - 'm_MeshMetrics[1]': 1 - m_MeshOptimizationFlags: 0 - m_StreamData: - serializedVersion: 2 - offset: 0 - size: 0 - path: + m_Mesh: {fileID: 717947434} --- !u!1001 &1307530043 PrefabInstance: m_ObjectHideFlags: 0 @@ -13828,6 +13504,171 @@ Transform: type: 3} m_PrefabInstance: {fileID: 1363773142} m_PrefabAsset: {fileID: 0} +--- !u!43 &1366333855 +Mesh: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: FluidContainer + serializedVersion: 11 + m_SubMeshes: + - serializedVersion: 2 + firstByte: 0 + indexCount: 36 + topology: 0 + baseVertex: 0 + firstVertex: 0 + vertexCount: 24 + localAABB: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 10, y: 10, z: 9} + m_Shapes: + vertices: [] + shapes: [] + channels: [] + fullWeights: [] + m_BindPose: [] + m_BoneNameHashes: + m_RootBoneNameHash: 0 + m_BonesAABB: [] + m_VariableBoneCountWeights: + m_Data: + m_MeshCompression: 0 + m_IsReadable: 1 + m_KeepVertices: 0 + m_KeepIndices: 0 + m_IndexFormat: 1 + m_IndexBuffer: 00000000010000000300000001000000020000000300000004000000050000000700000005000000060000000700000008000000090000000b000000090000000a0000000b0000000c0000000d0000000f0000000d0000000e0000000f000000100000001100000013000000110000001200000013000000140000001500000017000000150000001600000017000000 + m_VertexData: + serializedVersion: 3 + m_VertexCount: 24 + m_Channels: + - stream: 0 + offset: 0 + format: 0 + dimension: 3 + - stream: 0 + offset: 12 + format: 0 + dimension: 3 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 24 + format: 0 + dimension: 2 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + m_DataSize: 768 + _typelessdata: 000020c1000020c100001041000000800000803f000000800000803f0000803f00002041000020c100001041000000800000803f00000080000000000000803f00002041000020c1000010c1000000800000803f000000800000000000000000000020c1000020c1000010c1000000800000803f000000800000803f00000000000020c100002041000010c10000803f00000080000000800000803f0000803f000020c100002041000010410000803f0000008000000080000000000000803f000020c1000020c1000010410000803f00000080000000800000000000000000000020c1000020c1000010c10000803f00000080000000800000803f00000000000020c100002041000010410000008000000080000080bf0000803f0000803f0000204100002041000010410000008000000080000080bf000000000000803f00002041000020c1000010410000008000000080000080bf0000000000000000000020c1000020c1000010410000008000000080000080bf0000803f000000000000204100002041000010c100000080000000800000803f0000803f0000803f000020c100002041000010c100000080000000800000803f000000000000803f000020c1000020c1000010c100000080000000800000803f000000000000000000002041000020c1000010c100000080000000800000803f0000803f00000000000020410000204100001041000080bf00000080000000800000803f0000803f0000204100002041000010c1000080bf0000008000000080000000000000803f00002041000020c1000010c1000080bf0000008000000080000000000000000000002041000020c100001041000080bf00000080000000800000803f00000000000020c100002041000010c100000080000080bf000000800000803f0000803f0000204100002041000010c100000080000080bf00000080000000000000803f00002041000020410000104100000080000080bf000000800000000000000000000020c1000020410000104100000080000080bf000000800000803f00000000 + m_CompressedMesh: + m_Vertices: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_UV: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_Normals: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_Tangents: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_Weights: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_NormalSigns: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_TangentSigns: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_FloatColors: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_BoneIndices: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_Triangles: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_UVInfo: 0 + m_LocalAABB: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 10, y: 10, z: 9} + m_MeshUsageFlags: 0 + m_CookingOptions: 30 + m_BakedConvexCollisionMesh: + m_BakedTriangleCollisionMesh: + 'm_MeshMetrics[0]': 1 + 'm_MeshMetrics[1]': 1 + m_MeshOptimizationFlags: 1 + m_StreamData: + serializedVersion: 2 + offset: 0 + size: 0 + path: --- !u!1001 &1384229523 PrefabInstance: m_ObjectHideFlags: 0 @@ -13896,6 +13737,43 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 67c92a2e989ad604e9871dba9a8fc1a8, type: 3} +--- !u!84 &1403172320 +RenderTexture: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_ImageContentsHash: + serializedVersion: 2 + Hash: 00000000000000000000000000000000 + m_IsAlphaChannelOptional: 0 + serializedVersion: 6 + m_Width: 512 + m_Height: 512 + m_AntiAliasing: 1 + m_MipCount: -1 + m_DepthStencilFormat: 90 + m_ColorFormat: 4 + m_MipMap: 0 + m_GenerateMips: 1 + m_SRGB: 1 + m_UseDynamicScale: 0 + m_UseDynamicScaleExplicit: 0 + m_BindMS: 0 + m_EnableCompatibleFormat: 1 + m_EnableRandomWrite: 0 + m_TextureSettings: + serializedVersion: 2 + m_FilterMode: 1 + m_Aniso: 1 + m_MipBias: 0 + m_WrapU: 1 + m_WrapV: 1 + m_WrapW: 1 + m_Dimension: 2 + m_VolumeDepth: 1 + m_ShadowSamplingMode: 2 --- !u!1001 &1415194265 PrefabInstance: m_ObjectHideFlags: 0 @@ -14082,6 +13960,133 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: -55.34, z: 0} +--- !u!21 &1437978290 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: PortalMat (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) + (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) + (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) + (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) + (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) + (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) + (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) + (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) + (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) + (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) + (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) + (Instance) (Instance) (Instance) + m_Shader: {fileID: -6465566751694194690, guid: f90138ae641de784cb4b453bdc734b14, + type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseMap: + m_Texture: {fileID: 1403172320} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskMap: + m_Texture: {fileID: 2800000, guid: 84487d73ca4b791498332d8f6858417f, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMap: + m_Texture: {fileID: 2800000, guid: 9d67afb2ebc87cc43b5be99e1b689960, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Texture2DAsset_EAC75755_Out_0: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AlphaClip: 0 + - _Blend: 0 + - _BumpScale: 1 + - _Cull: 2 + - _Cutoff: 0.5 + - _DstBlend: 0 + - _EnvironmentReflections: 1 + - _GlossMapScale: 0 + - _Glossiness: 0 + - _GlossyReflections: 0 + - _Metallic: 0 + - _NormalSpeed: 0.36 + - _NormalStrength: 0.49 + - _NormalTiling: 0.41 + - _OcclusionStrength: 1 + - _OffsetStrength: 0.1 + - _PortalBrightness: 2 + - _QueueControl: 0 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _Smoothness: 0.5 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _Speed: 0.5 + - _SrcBlend: 1 + - _Surface: 0 + - _TwirlPower: 8 + - _WorkflowMode: 1 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EffectColor: {r: 0, g: 0.7548079, b: 1, a: 0} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} + m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!1 &1445433408 GameObject: m_ObjectHideFlags: 0 @@ -15218,6 +15223,22 @@ MonoBehaviour: onExecute: m_PersistentCalls: m_Calls: [] + - guid: b6b6048b-ca0a-41eb-997f-2fd9796542ae + onExecute: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1860084611} + m_TargetAssemblyTypeName: Beyond.BarkPlayer, Assembly-CSharp + m_MethodName: StartPlayer + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 --- !u!4 &1643408860 Transform: m_ObjectHideFlags: 0 @@ -15337,7 +15358,7 @@ Camera: serializedVersion: 2 m_Bits: 1410332535 m_RenderingPath: -1 - m_TargetTexture: {fileID: 717149104} + m_TargetTexture: {fileID: 146960043} m_TargetDisplay: 0 m_TargetEye: 3 m_HDR: 1 @@ -16593,6 +16614,171 @@ Canvas: type: 3} m_PrefabInstance: {fileID: 1848535792} m_PrefabAsset: {fileID: 0} +--- !u!43 &1847601607 +Mesh: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: FluidContainer + serializedVersion: 11 + m_SubMeshes: + - serializedVersion: 2 + firstByte: 0 + indexCount: 36 + topology: 0 + baseVertex: 0 + firstVertex: 0 + vertexCount: 24 + localAABB: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 10, y: 10, z: 9} + m_Shapes: + vertices: [] + shapes: [] + channels: [] + fullWeights: [] + m_BindPose: [] + m_BoneNameHashes: + m_RootBoneNameHash: 0 + m_BonesAABB: [] + m_VariableBoneCountWeights: + m_Data: + m_MeshCompression: 0 + m_IsReadable: 1 + m_KeepVertices: 0 + m_KeepIndices: 0 + m_IndexFormat: 1 + m_IndexBuffer: 00000000010000000300000001000000020000000300000004000000050000000700000005000000060000000700000008000000090000000b000000090000000a0000000b0000000c0000000d0000000f0000000d0000000e0000000f000000100000001100000013000000110000001200000013000000140000001500000017000000150000001600000017000000 + m_VertexData: + serializedVersion: 3 + m_VertexCount: 24 + m_Channels: + - stream: 0 + offset: 0 + format: 0 + dimension: 3 + - stream: 0 + offset: 12 + format: 0 + dimension: 3 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 24 + format: 0 + dimension: 2 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + m_DataSize: 768 + _typelessdata: 000020c1000020c100001041000000800000803f000000800000803f0000803f00002041000020c100001041000000800000803f00000080000000000000803f00002041000020c1000010c1000000800000803f000000800000000000000000000020c1000020c1000010c1000000800000803f000000800000803f00000000000020c100002041000010c10000803f00000080000000800000803f0000803f000020c100002041000010410000803f0000008000000080000000000000803f000020c1000020c1000010410000803f00000080000000800000000000000000000020c1000020c1000010c10000803f00000080000000800000803f00000000000020c100002041000010410000008000000080000080bf0000803f0000803f0000204100002041000010410000008000000080000080bf000000000000803f00002041000020c1000010410000008000000080000080bf0000000000000000000020c1000020c1000010410000008000000080000080bf0000803f000000000000204100002041000010c100000080000000800000803f0000803f0000803f000020c100002041000010c100000080000000800000803f000000000000803f000020c1000020c1000010c100000080000000800000803f000000000000000000002041000020c1000010c100000080000000800000803f0000803f00000000000020410000204100001041000080bf00000080000000800000803f0000803f0000204100002041000010c1000080bf0000008000000080000000000000803f00002041000020c1000010c1000080bf0000008000000080000000000000000000002041000020c100001041000080bf00000080000000800000803f00000000000020c100002041000010c100000080000080bf000000800000803f0000803f0000204100002041000010c100000080000080bf00000080000000000000803f00002041000020410000104100000080000080bf000000800000000000000000000020c1000020410000104100000080000080bf000000800000803f00000000 + m_CompressedMesh: + m_Vertices: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_UV: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_Normals: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_Tangents: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_Weights: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_NormalSigns: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_TangentSigns: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_FloatColors: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_BoneIndices: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_Triangles: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_UVInfo: 0 + m_LocalAABB: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 10, y: 10, z: 9} + m_MeshUsageFlags: 0 + m_CookingOptions: 30 + m_BakedConvexCollisionMesh: + m_BakedTriangleCollisionMesh: + 'm_MeshMetrics[0]': 1 + 'm_MeshMetrics[1]': 1 + m_MeshOptimizationFlags: 1 + m_StreamData: + serializedVersion: 2 + offset: 0 + size: 0 + path: --- !u!1001 &1848535792 PrefabInstance: m_ObjectHideFlags: 0 @@ -17105,13 +17291,16 @@ MonoBehaviour: m_appendSaverTypeToKey: 0 m_saveAcrossSceneChanges: 1 m_restoreStateOnStart: 0 - barkManagerEntryIndex: 75 + barkManagerEntryIndices: 4b000000 delayBetweenBarks: 0.5 + delayBetweenEntries: 5 shuffleOrder: 0 - loopWhileInside: 1 triggeringLayers: serializedVersion: 2 m_Bits: 0 + startAutomaticallyOnLoad: 0 + _runtime_IsStarted: 0 + currentEntryArrayIndex: 0 nextBarkSequenceIndex: 0 isTriggeringObjectInside: 0 --- !u!135 &1860084612 @@ -18369,132 +18558,6 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 91d75d0e4c2d46340b875dddc29767f5, type: 3} ---- !u!21 &1959370663 -Material: - serializedVersion: 8 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: PortalMat (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) - (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) - (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) - (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) - (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) - (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) - (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) - (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) - (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) - (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) (Instance) - (Instance) (Instance) (Instance) (Instance) (Instance) - m_Shader: {fileID: -6465566751694194690, guid: f90138ae641de784cb4b453bdc734b14, - type: 3} - m_Parent: {fileID: 0} - m_ModifiedSerializedProperties: 0 - m_ValidKeywords: [] - m_InvalidKeywords: [] - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: - - MOTIONVECTORS - m_LockedProperties: - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _BaseMap: - m_Texture: {fileID: 2017642928} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _BumpMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _EmissionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MaskMap: - m_Texture: {fileID: 2800000, guid: 84487d73ca4b791498332d8f6858417f, type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MetallicGlossMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _NormalMap: - m_Texture: {fileID: 2800000, guid: 9d67afb2ebc87cc43b5be99e1b689960, type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _OcclusionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _SpecGlossMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _Texture2DAsset_EAC75755_Out_0: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_Lightmaps: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_LightmapsInd: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_ShadowMasks: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Ints: [] - m_Floats: - - _AlphaClip: 0 - - _Blend: 0 - - _BumpScale: 1 - - _Cull: 2 - - _Cutoff: 0.5 - - _DstBlend: 0 - - _EnvironmentReflections: 1 - - _GlossMapScale: 0 - - _Glossiness: 0 - - _GlossyReflections: 0 - - _Metallic: 0 - - _NormalSpeed: 0.36 - - _NormalStrength: 0.49 - - _NormalTiling: 0.41 - - _OcclusionStrength: 1 - - _OffsetStrength: 0.1 - - _PortalBrightness: 2 - - _QueueControl: 0 - - _QueueOffset: 0 - - _ReceiveShadows: 1 - - _Smoothness: 0.5 - - _SmoothnessTextureChannel: 0 - - _SpecularHighlights: 1 - - _Speed: 0.5 - - _SrcBlend: 1 - - _Surface: 0 - - _TwirlPower: 8 - - _WorkflowMode: 1 - - _ZWrite: 1 - m_Colors: - - _BaseColor: {r: 1, g: 1, b: 1, a: 1} - - _Color: {r: 1, g: 1, b: 1, a: 1} - - _EffectColor: {r: 0, g: 0.7548079, b: 1, a: 0} - - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} - m_BuildTextureStacks: [] - m_AllowLocking: 1 --- !u!21 &1978211000 Material: serializedVersion: 8 @@ -18784,43 +18847,179 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 111f99aa5bba3d048b7db7e69c8d886d, type: 3} ---- !u!84 &2017642928 -RenderTexture: +--- !u!43 &1999385387 +Mesh: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: - m_ImageContentsHash: + m_Name: Quad Instance Instance Instance Instance Instance Instance Instance Instance + Instance Instance Instance Instance Instance Instance Instance Instance Instance + Instance Instance Instance Instance Instance Instance Instance Instance Instance + Instance Instance Instance Instance Instance Instance Instance Instance Instance + Instance Instance Instance Instance Instance Instance Instance Instance Instance + Instance Instance Instance Instance Instance Instance Instance Instance Instance + Instance Instance Instance Instance Instance Instance Instance Instance Instance + Instance Instance Instance Instance Instance Instance Instance Instance Instance + Instance Instance Instance Instance Instance Instance Instance Instance + serializedVersion: 11 + m_SubMeshes: + - serializedVersion: 2 + firstByte: 0 + indexCount: 6 + topology: 0 + baseVertex: 0 + firstVertex: 0 + vertexCount: 4 + localAABB: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0.5, y: 0.5, z: 3.0616168e-17} + m_Shapes: + vertices: [] + shapes: [] + channels: [] + fullWeights: [] + m_BindPose: [] + m_BoneNameHashes: + m_RootBoneNameHash: 0 + m_BonesAABB: [] + m_VariableBoneCountWeights: + m_Data: + m_MeshCompression: 0 + m_IsReadable: 1 + m_KeepVertices: 1 + m_KeepIndices: 1 + m_IndexFormat: 0 + m_IndexBuffer: 000003000100030000000200 + m_VertexData: + serializedVersion: 3 + m_VertexCount: 4 + m_Channels: + - stream: 0 + offset: 0 + format: 0 + dimension: 3 + - stream: 0 + offset: 12 + format: 0 + dimension: 3 + - stream: 0 + offset: 24 + format: 0 + dimension: 4 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 40 + format: 0 + dimension: 2 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + m_DataSize: 192 + _typelessdata: 000000bf000000bf31310da40000000000000000000080bf0000803f0000000000000000000080bf00000000000000000000003f000000bf31310da40000000000000000000080bf0000803f0000000000000000000080bf0000803f00000000000000bf0000003f31310d240000000000000000000080bf0000803f0000000000000000000080bf000000000000803f0000003f0000003f31310d240000000000000000000080bf0000803f0000000000000000000080bf0000803f0000803f + m_CompressedMesh: + m_Vertices: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_UV: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_Normals: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_Tangents: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_Weights: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_NormalSigns: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_TangentSigns: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_FloatColors: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_BoneIndices: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_Triangles: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_UVInfo: 0 + m_LocalAABB: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0.5, y: 0.5, z: 3.0616168e-17} + m_MeshUsageFlags: 0 + m_CookingOptions: 30 + m_BakedConvexCollisionMesh: + m_BakedTriangleCollisionMesh: + 'm_MeshMetrics[0]': 1 + 'm_MeshMetrics[1]': 1 + m_MeshOptimizationFlags: 0 + m_StreamData: serializedVersion: 2 - Hash: 00000000000000000000000000000000 - m_IsAlphaChannelOptional: 0 - serializedVersion: 6 - m_Width: 512 - m_Height: 512 - m_AntiAliasing: 1 - m_MipCount: -1 - m_DepthStencilFormat: 90 - m_ColorFormat: 4 - m_MipMap: 0 - m_GenerateMips: 1 - m_SRGB: 1 - m_UseDynamicScale: 0 - m_UseDynamicScaleExplicit: 0 - m_BindMS: 0 - m_EnableCompatibleFormat: 1 - m_EnableRandomWrite: 0 - m_TextureSettings: - serializedVersion: 2 - m_FilterMode: 1 - m_Aniso: 1 - m_MipBias: 0 - m_WrapU: 1 - m_WrapV: 1 - m_WrapW: 1 - m_Dimension: 2 - m_VolumeDepth: 1 - m_ShadowSamplingMode: 2 + offset: 0 + size: 0 + path: --- !u!1001 &2056480735 PrefabInstance: m_ObjectHideFlags: 0 @@ -18883,7 +19082,7 @@ PrefabInstance: type: 3} propertyPath: m_Mesh value: - objectReference: {fileID: 247765714} + objectReference: {fileID: 1847601607} - target: {fileID: 6799591510228445229, guid: 170cc915240b5e648b25eb8733f19040, type: 3} propertyPath: m_Name @@ -19029,7 +19228,7 @@ Camera: serializedVersion: 2 m_Bits: 1410332535 m_RenderingPath: -1 - m_TargetTexture: {fileID: 2017642928} + m_TargetTexture: {fileID: 1403172320} m_TargetDisplay: 0 m_TargetEye: 3 m_HDR: 1 @@ -19220,179 +19419,6 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!43 &2120007422 -Mesh: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Quad Instance Instance Instance Instance Instance Instance Instance Instance - Instance Instance Instance Instance Instance Instance Instance Instance Instance - Instance Instance Instance Instance Instance Instance Instance Instance Instance - Instance Instance Instance Instance Instance Instance Instance Instance Instance - Instance Instance Instance Instance Instance Instance Instance Instance Instance - Instance Instance Instance Instance Instance Instance Instance Instance Instance - Instance Instance Instance Instance Instance Instance Instance Instance Instance - Instance Instance Instance Instance Instance Instance Instance Instance Instance - Instance Instance Instance Instance - serializedVersion: 11 - m_SubMeshes: - - serializedVersion: 2 - firstByte: 0 - indexCount: 6 - topology: 0 - baseVertex: 0 - firstVertex: 0 - vertexCount: 4 - localAABB: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0.5, y: 0.5, z: 3.0616168e-17} - m_Shapes: - vertices: [] - shapes: [] - channels: [] - fullWeights: [] - m_BindPose: [] - m_BoneNameHashes: - m_RootBoneNameHash: 0 - m_BonesAABB: [] - m_VariableBoneCountWeights: - m_Data: - m_MeshCompression: 0 - m_IsReadable: 1 - m_KeepVertices: 1 - m_KeepIndices: 1 - m_IndexFormat: 0 - m_IndexBuffer: 000003000100030000000200 - m_VertexData: - serializedVersion: 3 - m_VertexCount: 4 - m_Channels: - - stream: 0 - offset: 0 - format: 0 - dimension: 3 - - stream: 0 - offset: 12 - format: 0 - dimension: 3 - - stream: 0 - offset: 24 - format: 0 - dimension: 4 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 40 - format: 0 - dimension: 2 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - - stream: 0 - offset: 0 - format: 0 - dimension: 0 - m_DataSize: 192 - _typelessdata: 000000bf000000bf31310da40000000000000000000080bf0000803f0000000000000000000080bf00000000000000000000003f000000bf31310da40000000000000000000080bf0000803f0000000000000000000080bf0000803f00000000000000bf0000003f31310d240000000000000000000080bf0000803f0000000000000000000080bf000000000000803f0000003f0000003f31310d240000000000000000000080bf0000803f0000000000000000000080bf0000803f0000803f - m_CompressedMesh: - m_Vertices: - m_NumItems: 0 - m_Range: 0 - m_Start: 0 - m_Data: - m_BitSize: 0 - m_UV: - m_NumItems: 0 - m_Range: 0 - m_Start: 0 - m_Data: - m_BitSize: 0 - m_Normals: - m_NumItems: 0 - m_Range: 0 - m_Start: 0 - m_Data: - m_BitSize: 0 - m_Tangents: - m_NumItems: 0 - m_Range: 0 - m_Start: 0 - m_Data: - m_BitSize: 0 - m_Weights: - m_NumItems: 0 - m_Data: - m_BitSize: 0 - m_NormalSigns: - m_NumItems: 0 - m_Data: - m_BitSize: 0 - m_TangentSigns: - m_NumItems: 0 - m_Data: - m_BitSize: 0 - m_FloatColors: - m_NumItems: 0 - m_Range: 0 - m_Start: 0 - m_Data: - m_BitSize: 0 - m_BoneIndices: - m_NumItems: 0 - m_Data: - m_BitSize: 0 - m_Triangles: - m_NumItems: 0 - m_Data: - m_BitSize: 0 - m_UVInfo: 0 - m_LocalAABB: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0.5, y: 0.5, z: 3.0616168e-17} - m_MeshUsageFlags: 0 - m_CookingOptions: 30 - m_BakedConvexCollisionMesh: - m_BakedTriangleCollisionMesh: - 'm_MeshMetrics[0]': 1 - 'm_MeshMetrics[1]': 1 - m_MeshOptimizationFlags: 0 - m_StreamData: - serializedVersion: 2 - offset: 0 - size: 0 - path: --- !u!4 &543450652227933697 stripped Transform: m_CorrespondingSourceObject: {fileID: 4745570059773410385, guid: 522b5cc88fa2e734b87247785b85c8fb, diff --git a/Assets/Scripts/Utils/BarkPlayer.cs b/Assets/Scripts/Utils/BarkPlayer.cs index 14f3de05f..d76150650 100644 --- a/Assets/Scripts/Utils/BarkPlayer.cs +++ b/Assets/Scripts/Utils/BarkPlayer.cs @@ -1,74 +1,102 @@ using System.Collections; using System.Collections.Generic; -using System.ComponentModel; using System.Linq; -using System.Linq.Expressions; using PixelCrushers; // For Saver +using Sirenix.OdinInspector; // For ReadOnly/Button attributes (Optional: remove if not using Odin) using UnityEngine; using Random = UnityEngine.Random; -namespace Beyond +namespace Beyond // Ensure this namespace matches your project { [RequireComponent(typeof(Collider))] public class BarkPlayer : Saver { - [Header("Bark Configuration")] - [Tooltip("The index of the BarkEntry in BarkManager's m_barks list.")] - public int barkManagerEntryIndex = 0; + #region Inspector Fields - [Tooltip("Delay in seconds after one bark's audio finishes before starting the next.")] + [Header("Bark Configuration")] + [Tooltip("The indices of the BarkEntries in BarkManager's list to play sequentially.")] + public int[] barkManagerEntryIndices = new int[0]; + + [Tooltip("Delay in seconds after one bark's audio finishes before starting the next bark WITHIN THE SAME entry sequence.")] + [Min(0f)] public float delayBetweenBarks = 0.5f; - [Tooltip("Play barks within the entry in a random order (shuffled once on start/load).")] - public bool shuffleOrder = false; + [Tooltip("Delay in seconds after ALL barks in one entry sequence finish before starting the NEXT entry sequence.")] + [Min(0f)] + public float delayBetweenEntries = 5.0f; - [Tooltip("Keep playing barks (looping the sequence if necessary) as long as an object on a triggering layer stays inside.")] - public bool loopWhileInside = true; + [Tooltip("Play barks within each entry in a random order (shuffled when the entry starts).")] + public bool shuffleOrder = false; [Header("Trigger Settings")] [Tooltip("Layers that can activate this bark trigger.")] - public LayerMask triggeringLayers; // User configures this in Inspector + public LayerMask triggeringLayers; - [Header("State (Read Only)")] - [SerializeField, ReadOnly(true)] - private int nextBarkSequenceIndex = 0; - [SerializeField, ReadOnly(true)] - private bool isTriggeringObjectInside = false; // Renamed for clarity + [Header("Activation")] + [Tooltip("If true, the BarkPlayer will be active automatically when the game starts or when loaded without existing save data for it.")] + public bool startAutomaticallyOnLoad = false; - // --- Internal Vars --- - // Removed PLAYER_LAYER_NAME constant - private List playbackOrder; + // Runtime state fields remain private but visible for debugging if needed + [Header("Runtime State (Read Only)")] + [SerializeField, ReadOnly] // Use Sirenix ReadOnly or remove if not using Odin + private bool _runtime_IsStarted = false; // Tracks the current operational state + + [SerializeField, ReadOnly] + private int currentEntryArrayIndex = 0; // Index for barkManagerEntryIndices array + + [SerializeField, ReadOnly] + private int nextBarkSequenceIndex = 0; // Index for playbackOrder (within current entry) + + [SerializeField, ReadOnly] + private bool isTriggeringObjectInside = false; // Is a valid object currently inside? + + #endregion + + #region Internal Variables + + private List playbackOrder; // Stores the bark order for the CURRENTLY active entry private bool isInitialized = false; private Collider triggerCollider; - private BarkManager barkManager; + private BarkManager barkManager; // Cached reference private Coroutine currentPlaybackCoroutine = null; - private Transform currentTriggererTransform = null; // Store the transform of the object inside + private Transform currentTriggererTransform = null; // Transform of the object inside + #endregion + + #region Save Data Structure - // --- Save Data --- (Remains the same) [System.Serializable] - public class BarkPlayerData { /* ... same as before ... */ - public int savedNextBarkSequenceIndex; - public List savedPlaybackOrder; - public bool wasShuffled; + public class BarkPlayerData + { + public bool savedIsStarted; // Tracks the saved state from _runtime_IsStarted + public int savedCurrentEntryArrayIndex; + public int savedNextBarkSequenceIndex; + public bool wasShuffled; // Tracks shuffle setting at time of save } private BarkPlayerData m_saveData = new BarkPlayerData(); - // --- Methods --- + #endregion + + #region Unity Lifecycle Methods public override void Awake() { - base.Awake(); + // Set initial state based on Inspector setting *before* base.Awake potentially calls ApplyData + // If save data exists, ApplyData will overwrite this. + _runtime_IsStarted = startAutomaticallyOnLoad; + base.Awake(); // This might call ApplyData via Save System + + // --- Component & Initial Setup --- triggerCollider = GetComponent(); if (!triggerCollider.isTrigger) { - Debug.LogWarning($"BarkPlayer on {gameObject.name}: Collider is not set to 'Is Trigger'. Forcing it.", this); + Debug.LogWarning($"BarkPlayer on {gameObject.name}: Collider was not set to 'Is Trigger'. Forcing it.", this); triggerCollider.isTrigger = true; } - // --- Set Default LayerMask if Unassigned --- - if (triggeringLayers.value == 0) // LayerMask is empty/unassigned in inspector + // --- Default LayerMask --- + if (triggeringLayers.value == 0) // LayerMask is empty/unassigned { int playerLayer = LayerMask.NameToLayer("Player"); if (playerLayer != -1) @@ -78,245 +106,443 @@ namespace Beyond } else { - // Layer "Player" doesn't exist, and no layers were assigned. Log an error. - Debug.LogError($"BarkPlayer on {gameObject.name}: Triggering Layers is not set in the inspector, and the default 'Player' layer was not found. This trigger will likely not activate.", this); - // Leave triggeringLayers as 0 (Nothing) + Debug.LogError($"BarkPlayer ({gameObject.name}): Triggering Layers is not set in the inspector, and the default 'Player' layer was not found. This trigger will likely not activate.", this); } } - // --- End LayerMask Default --- - - // Initialize save data defaults - m_saveData.savedNextBarkSequenceIndex = 0; - m_saveData.savedPlaybackOrder = null; - m_saveData.wasShuffled = shuffleOrder; - nextBarkSequenceIndex = 0; - isTriggeringObjectInside = false; + // Final state of _runtime_IsStarted reflects Inspector default OR loaded save data. } private void Start() { + // --- Get BarkManager Instance --- barkManager = BarkManager.Instance; if (barkManager == null) { - Debug.LogError($"BarkPlayer on {gameObject.name}: Could not find BarkManager instance!", this); + Debug.LogError($"BarkPlayer ({gameObject.name}): Could not find BarkManager instance! Disabling component.", this); enabled = false; return; } - InitializePlaybackOrder(); - isInitialized = true; - } + // --- Apply Loaded Indices --- + // Ensure array index is valid even if array size changed since saving + currentEntryArrayIndex = Mathf.Clamp(m_saveData.savedCurrentEntryArrayIndex, 0, Mathf.Max(0, barkManagerEntryIndices.Length - 1)); + // nextBarkSequenceIndex will be applied when PrepareEntrySequence is called - // InitializePlaybackOrder() remains the same as before - - private void InitializePlaybackOrder() - { - if (barkManager == null) return; - - int barkCount = barkManager.GetBarkCountInEntry(barkManagerEntryIndex); - if (barkCount <= 0) + // --- Validate Entry Indices --- + if (barkManagerEntryIndices == null || barkManagerEntryIndices.Length == 0) { - Debug.LogWarning($"BarkPlayer on {gameObject.name}: BarkEntry {barkManagerEntryIndex} has no barks. Disabling.", this); - playbackOrder = new List(); + Debug.LogWarning($"BarkPlayer ({gameObject.name}): No Bark Manager Entry Indices provided. Disabling.", this); enabled = false; return; } - - bool useLoadedOrder = m_saveData.savedPlaybackOrder != null && - m_saveData.wasShuffled == shuffleOrder && - m_saveData.savedPlaybackOrder.Count == barkCount; - - if (useLoadedOrder) + for (int i = 0; i < barkManagerEntryIndices.Length; i++) { - playbackOrder = new List(m_saveData.savedPlaybackOrder); - } - else - { - playbackOrder = Enumerable.Range(0, barkCount).ToList(); - if (shuffleOrder) + if (barkManagerEntryIndices[i] < 0 || barkManagerEntryIndices[i] >= barkManager.m_barks.Length) { - for (int i = playbackOrder.Count - 1; i > 0; i--) { - int j = Random.Range(0, i + 1); - (playbackOrder[i], playbackOrder[j]) = (playbackOrder[j], playbackOrder[i]); - } - m_saveData.wasShuffled = true; - } else { - m_saveData.wasShuffled = false; + Debug.LogError($"BarkPlayer ({gameObject.name}): Invalid Bark Manager Entry Index {barkManagerEntryIndices[i]} at array position {i}. Max index is {barkManager.m_barks.Length - 1}. Disabling.", this); + enabled = false; + return; } - m_saveData.savedPlaybackOrder = new List(playbackOrder); } - nextBarkSequenceIndex = Mathf.Clamp(m_saveData.savedNextBarkSequenceIndex, 0, playbackOrder.Count); + isInitialized = true; - if (nextBarkSequenceIndex >= playbackOrder.Count && !loopWhileInside) - { - Debug.Log($"BarkPlayer on {gameObject.name}: Sequence for entry {barkManagerEntryIndex} already completed (and not looping).", this); - } + // Check if we should start playing immediately after initialization + // (e.g., if loaded state is 'started' and player is already inside trigger) + CheckForAutoStartIfInside(); } + private void OnDrawGizmos() + { + Collider col = GetComponent(); + if (col != null) + { + Gizmos.color = isTriggeringObjectInside ? new Color(1f, 0.5f, 0.5f, 0.4f) : new Color(0.5f, 1f, 0.5f, 0.3f); // Red when active + if (col is BoxCollider box) Gizmos.DrawCube(transform.TransformPoint(box.center), Vector3.Scale(box.size, transform.lossyScale)); + else if (col is SphereCollider sphere) Gizmos.DrawSphere(transform.TransformPoint(sphere.center), sphere.radius * MaxComponent(transform.lossyScale)); + // Add other collider types if needed + } + } + + #endregion + + #region Trigger Handling private void OnTriggerEnter(Collider other) { - if (!isInitialized) return; + // Ignore if not initialized, not enabled, or runtime state is not 'Started' + if (!isInitialized || !enabled || !_runtime_IsStarted) return; - // --- Check Layer Mask --- + // --- Layer Check --- int otherLayer = other.gameObject.layer; - // Check if the entering object's layer is in our mask if ((triggeringLayers.value & (1 << otherLayer)) == 0) { - // Layer not in mask, ignore this trigger event - return; + return; // Layer not in mask, ignore this trigger event } - // --- End Layer Check --- - // Object on a triggering layer entered + // --- Check if already processing an object --- + // This prevents multiple triggering objects from interfering. Only the first one in matters. + if (isTriggeringObjectInside) return; + + // --- Valid Trigger --- Debug.Log($"BarkPlayer ({gameObject.name}): Triggering object '{other.name}' entered.", this); isTriggeringObjectInside = true; currentTriggererTransform = other.transform; // Store the transform for barking - // Start playback if not already running + // --- Start Playback Coroutine if not already running --- if (currentPlaybackCoroutine == null) { + // Apply potentially loaded/saved array index before starting loop + currentEntryArrayIndex = Mathf.Clamp(m_saveData.savedCurrentEntryArrayIndex, 0, Mathf.Max(0, barkManagerEntryIndices.Length - 1)); + // nextBarkSequenceIndex will be set by PrepareEntrySequence inside the coroutine currentPlaybackCoroutine = StartCoroutine(ContinuousPlaybackLoop()); } } private void OnTriggerExit(Collider other) { - if (!isInitialized) return; + if (!isInitialized || !enabled) return; - // --- Check Layer Mask --- - int otherLayer = other.gameObject.layer; - if ((triggeringLayers.value & (1 << otherLayer)) == 0) - { - // Ignore exit events from non-triggering layers - return; - } - // --- End Layer Check --- + // --- Layer Check --- + int otherLayer = other.gameObject.layer; + if ((triggeringLayers.value & (1 << otherLayer)) == 0) + { + return; // Ignore exit events from non-triggering layers + } - // Object on a triggering layer exited - // Important: Only react if the exiting object is the *same one* we stored. - // This handles cases where multiple triggering objects might enter/exit. + // --- Check if the *tracked* object is the one exiting --- if (other.transform == currentTriggererTransform) { Debug.Log($"BarkPlayer ({gameObject.name}): Triggering object '{other.name}' exited.", this); isTriggeringObjectInside = false; currentTriggererTransform = null; // Clear the stored transform - // Stop the playback coroutine + // --- Stop the Playback Coroutine --- if (currentPlaybackCoroutine != null) { StopCoroutine(currentPlaybackCoroutine); currentPlaybackCoroutine = null; Debug.Log($"BarkPlayer ({gameObject.name}): Stopping playback loop due to exit.", this); - // Optional: Stop BarkManager audio immediately + // Optional: Immediately stop BarkManager audio? // if (barkManager != null && barkManager.IsPlaying) barkManager.m_audioSource.Stop(); } } // Else: Some other object on a triggering layer exited, but the primary one is still inside. Do nothing. - } - // ContinuousPlaybackLoop now uses the stored currentTriggererTransform + #endregion + + #region Playback Logic + + /// + /// Sets up the playbackOrder list for a specific BarkManager entry index. + /// Resets or applies saved nextBarkSequenceIndex. + /// + /// The index within BarkManager's m_barks array. + /// True if preparation was successful (entry has barks), false otherwise. + private bool PrepareEntrySequence(int entryIndexToPrepare) + { + if (barkManager == null) return false; + + int barkCount = barkManager.GetBarkCountInEntry(entryIndexToPrepare); + if (barkCount <= 0) + { + Debug.LogWarning($"BarkPlayer ({gameObject.name}): BarkEntry {entryIndexToPrepare} (from array index {currentEntryArrayIndex}) has no barks. Skipping entry.", this); + playbackOrder = new List(); // Ensure list is empty + nextBarkSequenceIndex = 0; + return false; // Indicate nothing to play for this entry + } + + // Generate sequence order (sequential or shuffled) + playbackOrder = Enumerable.Range(0, barkCount).ToList(); + if (shuffleOrder) + { + // Simple Fisher-Yates shuffle + for (int i = playbackOrder.Count - 1; i > 0; i--) + { + int j = Random.Range(0, i + 1); + // Tuple swap is concise + (playbackOrder[i], playbackOrder[j]) = (playbackOrder[j], playbackOrder[i]); + } + // Debug.Log($"BarkPlayer ({gameObject.name}): Shuffled order for entry {entryIndexToPrepare}.", this); + } + + // Reset sequence progress. Apply saved index ONLY if the loaded array index matches the current one. + if (currentEntryArrayIndex == m_saveData.savedCurrentEntryArrayIndex) + { + nextBarkSequenceIndex = Mathf.Clamp(m_saveData.savedNextBarkSequenceIndex, 0, playbackOrder.Count); + // Debug.Log($"BarkPlayer ({gameObject.name}): Resuming entry {entryIndexToPrepare} at bark index {nextBarkSequenceIndex}.", this); + } + else + { + nextBarkSequenceIndex = 0; // Start new entry from beginning if array index differs from saved + } + + return true; // Preparation successful + } + + /// + /// Main coroutine managing the playback loop through entries and barks. + /// private IEnumerator ContinuousPlaybackLoop() { Debug.Log($"BarkPlayer ({gameObject.name}): Starting playback loop.", this); - // Ensure we have a target transform before proceeding - while (currentTriggererTransform == null && isTriggeringObjectInside) + // Initial check for valid configuration + if (barkManagerEntryIndices == null || barkManagerEntryIndices.Length == 0) { - Debug.LogWarning($"BarkPlayer ({gameObject.name}): Waiting for valid triggerer transform.", this); - yield return null; // Wait a frame if trigger happened but transform wasn't stored yet (unlikely but safe) + Debug.LogError($"BarkPlayer ({gameObject.name}): Cannot start loop, entry indices array is empty or null.", this); + currentPlaybackCoroutine = null; // Ensure coroutine reference is cleared + yield break; } - // Main loop runs while a triggering object is inside AND we have its transform + // Outer loop: Continues as long as a valid triggering object is inside while (isTriggeringObjectInside && currentTriggererTransform != null) { - if (playbackOrder == null || playbackOrder.Count == 0) + // --- Step 1: Prepare for Current Entry --- + // Safety check/loop wrap for the array index + if (currentEntryArrayIndex >= barkManagerEntryIndices.Length) { - Debug.LogWarning($"BarkPlayer ({gameObject.name}): No barks to play in entry {barkManagerEntryIndex}.", this); - yield break; + currentEntryArrayIndex = 0; + if (barkManagerEntryIndices.Length == 0) + { // Should be caught earlier, but double-check + Debug.LogError($"BarkPlayer ({gameObject.name}): Entry indices array became empty during loop?", this); + yield break; + } } - bool sequenceFinished = nextBarkSequenceIndex >= playbackOrder.Count; + int currentManagerEntryIndex = barkManagerEntryIndices[currentEntryArrayIndex]; + // Debug.Log($"BarkPlayer ({gameObject.name}): Preparing Entry Index: {currentManagerEntryIndex} (Array Pos: {currentEntryArrayIndex}).", this); - if (sequenceFinished) + // Prepare the sequence (generate playbackOrder, set nextBarkSequenceIndex) + bool canPlayEntry = PrepareEntrySequence(currentManagerEntryIndex); + + if (!canPlayEntry) // Skip this entry if it has no barks { - if (loopWhileInside) + // Debug.Log($"BarkPlayer ({gameObject.name}): Skipping empty BarkEntry {currentManagerEntryIndex}.", this); + currentEntryArrayIndex++; // Move immediately to the next entry index + yield return null; // Wait a frame before checking the next entry in the outer loop + continue; // Go to next iteration of the outer while loop (skips delays below) + } + + + // --- Step 2: Inner Loop - Play Barks within the Current Entry --- + while (nextBarkSequenceIndex < playbackOrder.Count && isTriggeringObjectInside && currentTriggererTransform != null) + { + // Wait for BarkManager's AudioSource if it's busy + while (barkManager.IsPlaying && isTriggeringObjectInside) { - Debug.Log($"BarkPlayer ({gameObject.name}): Sequence finished, looping.", this); - nextBarkSequenceIndex = 0; - if (shuffleOrder) { - InitializePlaybackOrder(); - nextBarkSequenceIndex = 0; - if (playbackOrder.Count == 0) yield break; + yield return null; // Wait a frame + } + // Re-check condition after waiting, player might have left + if (!isTriggeringObjectInside || currentTriggererTransform == null) break; + + + // Play the specific bark for this step in the sequence + int barkIndexToPlay = playbackOrder[nextBarkSequenceIndex]; + Debug.Log($"BarkPlayer ({gameObject.name}): Playing Bark {nextBarkSequenceIndex + 1}/{playbackOrder.Count} (Actual Index: {barkIndexToPlay}) from Entry {currentManagerEntryIndex}.", this); + + // Play using the specific index, passing the triggerer's transform + AudioClip playedClip = barkManager.PlayBark(currentManagerEntryIndex, currentTriggererTransform, barkIndexToPlay); + + nextBarkSequenceIndex++; // Increment progress within this entry's sequence + + // Wait for the bark's duration plus the inter-bark delay + float waitTime = delayBetweenBarks; + if (playedClip != null) { waitTime += Mathf.Max(0f, playedClip.length); } // Ensure non-negative length + + // Perform the wait, checking continuously if the player leaves + if (waitTime > 0) + { + float timer = 0f; + while (timer < waitTime && isTriggeringObjectInside && currentTriggererTransform != null) + { + timer += Time.deltaTime; + yield return null; // Wait one frame } } else { - Debug.Log($"BarkPlayer ({gameObject.name}): Sequence finished, not looping. Waiting for exit.", this); - // Wait until trigger object leaves - while(isTriggeringObjectInside && currentTriggererTransform != null) { yield return null; } - yield break; // Exit coroutine + // Minimum one frame wait even if no delay/clip length + yield return null; } + + // If player left during wait, break inner loop + if (!isTriggeringObjectInside || currentTriggererTransform == null) break; + + } // --- End of Inner Loop (Barks within Entry) --- + + + // --- Step 3: Transition to Next Entry (if player didn't exit) --- + if (isTriggeringObjectInside && currentTriggererTransform != null) + { + // Current entry sequence finished normally + Debug.Log($"BarkPlayer ({gameObject.name}): Finished sequence for Entry {currentManagerEntryIndex}.", this); + + currentEntryArrayIndex++; // Move to the next entry index in the array + + // Check for wrapping / end of all entries in the array + if (currentEntryArrayIndex >= barkManagerEntryIndices.Length) + { + Debug.Log($"BarkPlayer ({gameObject.name}): Finished all entries in the array. Looping back.", this); + currentEntryArrayIndex = 0; // Loop back to the start of the array + } + + // Wait for the specified delay BETWEEN entries + if (delayBetweenEntries > 0) + { + Debug.Log($"BarkPlayer ({gameObject.name}): Waiting {delayBetweenEntries}s before next entry.", this); + float timer = 0f; + while (timer < delayBetweenEntries && isTriggeringObjectInside && currentTriggererTransform != null) + { + timer += Time.deltaTime; + yield return null; // Wait one frame + } + // If player left during delay, break outer loop + if (!isTriggeringObjectInside || currentTriggererTransform == null) break; + } + // The outer loop will then continue, preparing the next entry } - // Wait for BarkManager's AudioSource if necessary - if (barkManager.IsPlaying) - { - yield return null; - continue; - } + } // --- End of Outer Loop (isTriggeringObjectInside) --- - // Play the bark using the stored transform - int barkIndexToPlay = playbackOrder[nextBarkSequenceIndex]; - Debug.Log($"BarkPlayer ({gameObject.name}): Playing bark {nextBarkSequenceIndex} (actual index: {barkIndexToPlay}) targeting '{currentTriggererTransform.name}'.", this); - - // Pass the stored transform - AudioClip playedClip = barkManager.PlayBark(barkManagerEntryIndex, currentTriggererTransform, barkIndexToPlay); - - nextBarkSequenceIndex++; - - float waitTime = delayBetweenBarks; - if (playedClip != null) { waitTime += Mathf.Max(0f, playedClip.length); } - - if (waitTime > 0) { yield return new WaitForSeconds(waitTime); } - else { yield return null; } - } - - Debug.Log($"BarkPlayer ({gameObject.name}): Playback loop finished (Triggering object left or transform lost).", this); - // Reset coroutine reference *if* it was this instance that finished it - // (OnTriggerExit might have already cleared it) - if (currentPlaybackCoroutine != null && !isTriggeringObjectInside) { - currentPlaybackCoroutine = null; + Debug.Log($"BarkPlayer ({gameObject.name}): Playback loop finished (Triggering object left or component stopped).", this); + // Clear coroutine reference *if* this coroutine instance is the one finishing + if (currentPlaybackCoroutine != null && (!isTriggeringObjectInside || currentTriggererTransform == null)) + { + currentPlaybackCoroutine = null; } } + #endregion - // --- Save System Integration --- (Remains the same) - public override string RecordData() { /* ... same as before ... */ + #region Public Control Methods + + /// + /// Enables the BarkPlayer's runtime operation. It will start playing sequences when triggered. + /// If a triggering object is already inside, playback may start immediately. + /// + [Button] // Example for Odin Inspector button + public void StartPlayer() + { + if (!_runtime_IsStarted) + { + Debug.Log($"BarkPlayer ({gameObject.name}): Player Runtime Started.", this); + _runtime_IsStarted = true; + // If already initialized, check if we need to immediately start playback + if (isInitialized) + { + CheckForAutoStartIfInside(); + } + } + } + + /// + /// Disables the BarkPlayer's runtime operation. Stops any current playback and ignores future triggers. + /// + [Button] // Example for Odin Inspector button + public void StopPlayer() + { + if (_runtime_IsStarted) + { + Debug.Log($"BarkPlayer ({gameObject.name}): Player Runtime Stopped.", this); + _runtime_IsStarted = false; + + // Stop any currently running playback coroutine + if (currentPlaybackCoroutine != null) + { + StopCoroutine(currentPlaybackCoroutine); + currentPlaybackCoroutine = null; // Clear the reference + Debug.Log($"BarkPlayer ({gameObject.name}): Stopping active playback loop.", this); + // Optional: Immediately stop BarkManager audio? + // if (barkManager != null && barkManager.IsPlaying) barkManager.m_audioSource.Stop(); + } + } + } + + /// + /// Checks if the player is currently inside the trigger and starts the playback loop + /// if the BarkPlayer is started (_runtime_IsStarted=true) but the loop isn't currently running. + /// Useful after initialization (in Start) or after calling StartPlayer manually. + /// + private void CheckForAutoStartIfInside() + { + if (_runtime_IsStarted && isTriggeringObjectInside && currentTriggererTransform != null && currentPlaybackCoroutine == null && isInitialized) + { + Debug.Log($"BarkPlayer ({gameObject.name}): Triggering object already inside and player is started. Starting playback loop.", this); + // Ensure indices are correctly set from save data before starting + currentEntryArrayIndex = Mathf.Clamp(m_saveData.savedCurrentEntryArrayIndex, 0, Mathf.Max(0, barkManagerEntryIndices.Length - 1)); + currentPlaybackCoroutine = StartCoroutine(ContinuousPlaybackLoop()); + } + } + + #endregion + + #region Save System Integration (Pixel Crushers Saver) + + public override string RecordData() + { + // Update save data container with current runtime state + m_saveData.savedIsStarted = this._runtime_IsStarted; + m_saveData.savedCurrentEntryArrayIndex = this.currentEntryArrayIndex; m_saveData.savedNextBarkSequenceIndex = this.nextBarkSequenceIndex; - m_saveData.savedPlaybackOrder = new List(this.playbackOrder ?? new List()); - m_saveData.wasShuffled = this.shuffleOrder; + m_saveData.wasShuffled = this.shuffleOrder; // Record shuffle setting at time of save + + // Serialize the save data container return SaveSystem.Serialize(m_saveData); } - public override void ApplyData(string s) { /* ... same as before ... */ - if (string.IsNullOrEmpty(s)) return; - var loadedData = SaveSystem.Deserialize(s); - if (loadedData != null) { m_saveData = loadedData; } - else Debug.LogError($"BarkPlayer ({gameObject.name}): Failed to deserialize save data.", this); + + public override void ApplyData(string s) + { + // Handle case where there is no save data for this component + if (string.IsNullOrEmpty(s)) + { + // No save data - runtime state keeps the value set by startAutomaticallyOnLoad in Awake + _runtime_IsStarted = startAutomaticallyOnLoad; + // Reset progress indices if no save data + m_saveData.savedCurrentEntryArrayIndex = 0; + m_saveData.savedNextBarkSequenceIndex = 0; + Debug.Log($"BarkPlayer ({gameObject.name}): No save data found, using startAutomaticallyOnLoad ({startAutomaticallyOnLoad}).", this); + return; + } + + // Deserialize the saved data string + var loadedData = SaveSystem.Deserialize(s); + if (loadedData != null) + { + m_saveData = loadedData; // Store the loaded data + // Apply the loaded runtime state + this._runtime_IsStarted = m_saveData.savedIsStarted; + // Indices will be applied in Start() / PrepareEntrySequence() using m_saveData + Debug.Log($"BarkPlayer ({gameObject.name}): Applied loaded data. Started={_runtime_IsStarted}, EntryIdx={m_saveData.savedCurrentEntryArrayIndex}, BarkIdx={m_saveData.savedNextBarkSequenceIndex}.", this); + } + else + { + Debug.LogError($"BarkPlayer ({gameObject.name}): Failed to deserialize save data. Using defaults.", this); + // Fallback: use inspector setting if deserialize failed + this._runtime_IsStarted = startAutomaticallyOnLoad; + m_saveData.savedCurrentEntryArrayIndex = 0; + m_saveData.savedNextBarkSequenceIndex = 0; + } + + // After applying data, ensure consistency: if loaded state is 'stopped', stop coroutine + if (!this._runtime_IsStarted && currentPlaybackCoroutine != null) + { + StopCoroutine(currentPlaybackCoroutine); + currentPlaybackCoroutine = null; + } + // The CheckForAutoStartIfInside() call in Start() will handle restarting the + // coroutine if the loaded state is 'started' and the player is inside the trigger. } - // --- Gizmos --- (Remain the same, uses isTriggeringObjectInside now) - private void OnDrawGizmos() { - Collider col = GetComponent(); - if (col != null) { - Gizmos.color = isTriggeringObjectInside ? new Color(1f, 0.5f, 0.5f, 0.4f) : new Color(0.5f, 1f, 0.5f, 0.3f); - if (col is BoxCollider box) Gizmos.DrawCube(transform.TransformPoint(box.center), Vector3.Scale(box.size, transform.lossyScale)); - else if (col is SphereCollider sphere) Gizmos.DrawSphere(transform.TransformPoint(sphere.center), sphere.radius * MaxComponent(transform.lossyScale)); - } - } + #endregion + + #region Helper Methods + + /// Helper to find the largest component of a Vector3 (for Gizmos). private float MaxComponent(Vector3 v) => Mathf.Max(Mathf.Max(v.x, v.y), v.z); + + #endregion } } \ No newline at end of file