Large diffs are not rendered by default.

@@ -0,0 +1,132 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1969464586288990}
m_IsPrefabParent: 1
--- !u!1 &1969464586288990
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4624238766591502}
- component: {fileID: 212973463131077570}
- component: {fileID: 58103761276181002}
- component: {fileID: 114931631007718942}
m_Layer: 8
m_Name: Object_Crack
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4624238766591502
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1969464586288990}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 4.67, y: 0.304, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!58 &58103761276181002
CircleCollider2D:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1969464586288990}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
serializedVersion: 2
m_Radius: 0.25
--- !u!114 &114931631007718942
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1969464586288990}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ea01928b23d6ccf41a7a86e4949f7da4, type: 3}
m_Name:
m_EditorClassIdentifier:
entityName: Crackidoodle
canUseCondition:
aminaUse: 0
idaUse: 1
jonathanUse: 0
interactionEvents:
m_PersistentCalls:
m_Calls: []
m_TypeName: ValueEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
inspectEvents:
m_PersistentCalls:
m_Calls: []
m_TypeName: ValueEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
exitDoor: {fileID: 0}
doorLocked: 1
key: {fileID: 0}
minRadiusDistance: 0.5
transitionTime: 1
--- !u!212 &212973463131077570
SpriteRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1969464586288990}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: -53827209
m_SortingLayer: -2
m_SortingOrder: 1
m_Sprite: {fileID: 21300000, guid: 7de20ff5f241c4c4c822ab420912366d, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 1.024, y: 1.024}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
@@ -9,47 +9,47 @@ Prefab:
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1365581077830420}
m_RootGameObject: {fileID: 1360348029100302}
m_IsPrefabParent: 1
--- !u!1 &1365581077830420
--- !u!1 &1360348029100302
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4573197448550178}
- component: {fileID: 212401751274955936}
- component: {fileID: 70195333828606526}
- component: {fileID: 50001743792801070}
- component: {fileID: 114210300908721990}
m_Layer: 10
m_Name: Farfar_88
- component: {fileID: 4668089087772036}
- component: {fileID: 212092956864332588}
- component: {fileID: 61017050823938532}
- component: {fileID: 114280111051947786}
- component: {fileID: 50340311483292618}
m_Layer: 9
m_Name: Object_LoosePlank
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4573197448550178
--- !u!4 &4668089087772036
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1365581077830420}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 3.39, y: -3.41, z: 0}
m_LocalScale: {x: 0.3690114, y: 0.3690114, z: 0.3690114}
m_GameObject: {fileID: 1360348029100302}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 4.694, y: 0.38, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!50 &50001743792801070
--- !u!50 &50340311483292618
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1365581077830420}
m_GameObject: {fileID: 1360348029100302}
m_BodyType: 0
m_Simulated: 1
m_UseFullKinematicContacts: 0
@@ -63,49 +63,74 @@ Rigidbody2D:
m_SleepingMode: 1
m_CollisionDetection: 0
m_Constraints: 0
--- !u!70 &70195333828606526
CapsuleCollider2D:
--- !u!61 &61017050823938532
BoxCollider2D:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1365581077830420}
m_GameObject: {fileID: 1360348029100302}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
m_Size: {x: 2, y: 4}
m_Direction: 0
--- !u!114 &114210300908721990
m_Offset: {x: 0, y: -0.1}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5, y: 0.5}
oldSize: {x: 1.024, y: 1.024}
newSize: {x: 1.024, y: 1.024}
adaptiveTilingThreshold: 0.5
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 0.72, y: 0.27}
m_EdgeRadius: 0
--- !u!114 &114280111051947786
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1365581077830420}
m_GameObject: {fileID: 1360348029100302}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: eec0484d2d65b8245b4064acd01e1b28, type: 3}
m_Name:
m_EditorClassIdentifier:
entityName: Ivar
entityName: Loose Plank
interactDistance: 1
canUseCondition:
aminaUse: 1
idaUse: 1
jonathanUse: 1
idaUse: 0
jonathanUse: 0
interactionEvents:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 0}
m_MethodName: set_enabled
m_Mode: 6
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 1
m_CallState: 2
m_TypeName: ValueEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
inspectEvents:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
inventorySprite: {fileID: 21300000, guid: 27c606da07ee6094c96a720949aa31c5, type: 3}
--- !u!212 &212401751274955936
m_TypeName: ValueEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
inventorySprite: {fileID: 21300000, guid: cadddab37ee228a4d94a8ed4d7292e2c, type: 3}
--- !u!212 &212092956864332588
SpriteRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1365581077830420}
m_GameObject: {fileID: 1360348029100302}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
@@ -134,12 +159,12 @@ SpriteRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: a1913c2e628561d4db60c8afa9a0f5fe, type: 3}
m_Sprite: {fileID: 21300000, guid: cadddab37ee228a4d94a8ed4d7292e2c, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 4.22, y: 5.94}
m_Size: {x: 1.024, y: 1.024}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1

Large diffs are not rendered by default.

@@ -0,0 +1,142 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1998144500013746}
m_IsPrefabParent: 1
--- !u!1 &1998144500013746
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4643777762780164}
- component: {fileID: 212846446708993538}
- component: {fileID: 61155654105806720}
- component: {fileID: 114129971231030468}
m_Layer: 8
m_Name: Object_OutsideDoor
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4643777762780164
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1998144500013746}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.09, y: 1.48, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!61 &61155654105806720
BoxCollider2D:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1998144500013746}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0.05, y: 0.15}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5, y: 0.5}
oldSize: {x: 4.096, y: 4.096}
newSize: {x: 20.48, y: 20.48}
adaptiveTilingThreshold: 0.5
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 1, y: 2}
m_EdgeRadius: 0
--- !u!114 &114129971231030468
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1998144500013746}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ea01928b23d6ccf41a7a86e4949f7da4, type: 3}
m_Name:
m_EditorClassIdentifier:
entityName: House Door
canUseCondition:
aminaUse: 1
idaUse: 1
jonathanUse: 1
interactionEvents:
m_PersistentCalls:
m_Calls: []
m_TypeName: ValueEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
inspectEvents:
m_PersistentCalls:
m_Calls: []
m_TypeName: ValueEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
exitDoor: {fileID: 0}
doorLocked: 1
key: {fileID: 0}
minRadiusDistance: 1.6
transitionTime: 1
--- !u!212 &212846446708993538
SpriteRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1998144500013746}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: -53827209
m_SortingLayer: -2
m_SortingOrder: 1
m_Sprite: {fileID: 21300000, guid: b7a87c840c4664f4a813b547ac98664e, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 20.48, y: 20.48}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
@@ -0,0 +1,142 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1943161982552374}
m_IsPrefabParent: 1
--- !u!1 &1943161982552374
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4907997107430228}
- component: {fileID: 212091099747326750}
- component: {fileID: 61166341245081294}
- component: {fileID: 114414455525823648}
m_Layer: 8
m_Name: Object_ShedDoor
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4907997107430228
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1943161982552374}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 15.72, y: 1.165, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!61 &61166341245081294
BoxCollider2D:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1943161982552374}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: -0.02, y: -0.1}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.55, y: 0.25}
oldSize: {x: 4.096, y: 4.096}
newSize: {x: 4.096, y: 4.096}
adaptiveTilingThreshold: 0.5
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 1, y: 1.9}
m_EdgeRadius: 0
--- !u!114 &114414455525823648
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1943161982552374}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ea01928b23d6ccf41a7a86e4949f7da4, type: 3}
m_Name:
m_EditorClassIdentifier:
entityName: Shed Door
interactDistance: 1
canUseCondition:
aminaUse: 1
idaUse: 1
jonathanUse: 1
interactionEvents:
m_PersistentCalls:
m_Calls: []
m_TypeName: ValueEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
inspectEvents:
m_PersistentCalls:
m_Calls: []
m_TypeName: ValueEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
exitDoor: {fileID: 0}
doorLocked: 0
key: {fileID: 0}
transitionTime: 1
--- !u!212 &212091099747326750
SpriteRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1943161982552374}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: -53827209
m_SortingLayer: -2
m_SortingOrder: 1
m_Sprite: {fileID: 21300000, guid: 7c39c32071861b34f9d7948d92157639, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 4.096, y: 4.096}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -9,168 +9,168 @@ Prefab:
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1928099678927314}
m_RootGameObject: {fileID: 1073895089668810}
m_IsPrefabParent: 1
--- !u!1 &1284122836418756
--- !u!1 &1073895089668810
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4661661380460342}
- component: {fileID: 82332731781386618}
- component: {fileID: 4188601336628392}
- component: {fileID: 114674698988657994}
m_Layer: 0
m_Name: Ida
m_Name: MusicPlayer
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1318931051695530
--- !u!1 &1111109511252396
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4487180578914142}
- component: {fileID: 82437637607273260}
- component: {fileID: 4126246879704184}
- component: {fileID: 82087109546695786}
m_Layer: 0
m_Name: Jonatan
m_Name: piano (jonatan)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1344132537860598
--- !u!1 &1219259899315346
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4630287805068230}
- component: {fileID: 82928666829230508}
- component: {fileID: 4655244673747508}
- component: {fileID: 82804267870730090}
m_Layer: 0
m_Name: Amina
m_Name: base track
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1526976172383890
--- !u!1 &1716349391789960
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4692725217689326}
- component: {fileID: 82240600376830330}
- component: {fileID: 4643274970653354}
- component: {fileID: 82933208111412662}
m_Layer: 0
m_Name: Base Track
m_Name: bas (amina)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1928099678927314
--- !u!1 &1991739208325144
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4049550254657996}
- component: {fileID: 114614888583121414}
- component: {fileID: 4465327531998224}
- component: {fileID: 82202869565666586}
m_Layer: 0
m_Name: MusicPlayer
m_Name: vibraphone (ida)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4049550254657996
--- !u!4 &4126246879704184
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1928099678927314}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.99992275, y: -1.8519756, z: -0.10635716}
m_GameObject: {fileID: 1111109511252396}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4692725217689326}
- {fileID: 4630287805068230}
- {fileID: 4487180578914142}
- {fileID: 4661661380460342}
m_Father: {fileID: 0}
m_RootOrder: 0
m_Children: []
m_Father: {fileID: 4188601336628392}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4487180578914142
--- !u!4 &4188601336628392
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1318931051695530}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_GameObject: {fileID: 1073895089668810}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.99992275, y: -1.8519756, z: -0.10635716}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4049550254657996}
m_RootOrder: 2
m_Children:
- {fileID: 4655244673747508}
- {fileID: 4643274970653354}
- {fileID: 4126246879704184}
- {fileID: 4465327531998224}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4630287805068230
--- !u!4 &4465327531998224
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1344132537860598}
m_GameObject: {fileID: 1991739208325144}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4049550254657996}
m_RootOrder: 1
m_Father: {fileID: 4188601336628392}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4661661380460342
--- !u!4 &4643274970653354
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1284122836418756}
m_GameObject: {fileID: 1716349391789960}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4049550254657996}
m_RootOrder: 3
m_Father: {fileID: 4188601336628392}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4692725217689326
--- !u!4 &4655244673747508
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1526976172383890}
m_GameObject: {fileID: 1219259899315346}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4049550254657996}
m_Father: {fileID: 4188601336628392}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &82240600376830330
--- !u!82 &82087109546695786
AudioSource:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1526976172383890}
m_GameObject: {fileID: 1111109511252396}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 243397838039039640, guid: 0da65e85ae3e14541bb9ef961581f29c,
type: 2}
m_audioClip: {fileID: 8300000, guid: 5bf2e1a015a8a8f40854e8af7a30ef05, type: 3}
m_audioClip: {fileID: 8300000, guid: 1716e5d2099011f4fbdbc08e20492e86, type: 3}
m_PlayOnAwake: 1
m_Volume: 0.8
m_Pitch: 1
@@ -241,12 +241,12 @@ AudioSource:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
--- !u!82 &82332731781386618
--- !u!82 &82202869565666586
AudioSource:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1284122836418756}
m_GameObject: {fileID: 1991739208325144}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 243397838039039640, guid: 0da65e85ae3e14541bb9ef961581f29c,
@@ -322,19 +322,19 @@ AudioSource:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
--- !u!82 &82437637607273260
--- !u!82 &82804267870730090
AudioSource:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1318931051695530}
m_GameObject: {fileID: 1219259899315346}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 243397838039039640, guid: 0da65e85ae3e14541bb9ef961581f29c,
type: 2}
m_audioClip: {fileID: 8300000, guid: 1716e5d2099011f4fbdbc08e20492e86, type: 3}
m_audioClip: {fileID: 8300000, guid: 5bf2e1a015a8a8f40854e8af7a30ef05, type: 3}
m_PlayOnAwake: 1
m_Volume: 0.8
m_Volume: 0
m_Pitch: 1
Loop: 1
Mute: 0
@@ -403,12 +403,12 @@ AudioSource:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
--- !u!82 &82928666829230508
--- !u!82 &82933208111412662
AudioSource:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1344132537860598}
m_GameObject: {fileID: 1716349391789960}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 243397838039039640, guid: 0da65e85ae3e14541bb9ef961581f29c,
@@ -484,12 +484,12 @@ AudioSource:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
--- !u!114 &114614888583121414
--- !u!114 &114674698988657994
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1928099678927314}
m_GameObject: {fileID: 1073895089668810}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1aa351c2fdc6b4349ba1e1e2ee6f4ed9, type: 3}
@@ -500,20 +500,26 @@ MonoBehaviour:
type: 2}
startFadingIn: 1
tracks:
- trackSource: {fileID: 82240600376830330}
- trackSource: {fileID: 82804267870730090}
trackClip: {fileID: 8300000, guid: 5bf2e1a015a8a8f40854e8af7a30ef05, type: 3}
currentVolume: 0
targetVolume: 1
fadeDuration: 5
- trackSource: {fileID: 82928666829230508}
- trackSource: {fileID: 82933208111412662}
trackClip: {fileID: 8300000, guid: eb97ef68df051f241a48f1b6d9324360, type: 3}
targetVolume: 0
currentVolume: 0.8
targetVolume: 1
fadeDuration: 5
- trackSource: {fileID: 82437637607273260}
- trackSource: {fileID: 82087109546695786}
trackClip: {fileID: 8300000, guid: 1716e5d2099011f4fbdbc08e20492e86, type: 3}
targetVolume: 0
currentVolume: 0.8
targetVolume: 1
fadeDuration: 5
- trackSource: {fileID: 82332731781386618}
- trackSource: {fileID: 82202869565666586}
trackClip: {fileID: 8300000, guid: e74bec8b03750ac46841d7cfad49fd7d, type: 3}
targetVolume: 0
currentVolume: 0.8
targetVolume: 1
fadeDuration: 5
autoPopulateTracks: 0
autoPopulateTracks: 1
automaticRenaming: 0
defaultFadeDuration: 0

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -2,7 +2,7 @@
using System.Collections.Generic;
using UnityEngine;

public class Amina : MonoBehaviour
public class Amina : Character
{
void Start ()
{
@@ -6,36 +6,87 @@ namespace MusicMixer
{
static public class MusicController
{
/// <summary>
/// Prefix used for all logged debug messages
/// </summary>
private static readonly string debugPrefix = "<color=darkblue><b>MusicController</b></color> - ";

public static readonly string[] trackNames;

public static MusicPlayer ActiveMusicPlayer
/// <summary>
/// Finds and returns the active MusicPlayer.
/// If there are no MusicPlayer present a new one will be instantiated from default if possible, empty if resource is missing.
/// </summary>
private static MusicPlayer ActiveMusicPlayer
{
get
{
// Try to find MusicPlayer in scene
if (GameObject.FindObjectOfType<MusicPlayer>() != null)
{
return GameObject.FindObjectOfType<MusicPlayer>();
}
else
{
// TODO: Add Resource for the prefab containing the finished music player
// Check for and instantiate default MusicPlayer prefab in Resources folder
if (Resources.FindObjectsOfTypeAll(typeof(MusicPlayer)).Length > 0)
{
LogWarning("No MusicPlayer found in active scene. Instantiating default MusicPlayer located in Resources folder.");

// Make a new gameobject and attach the music player to it
GameObject refObj = new GameObject("New Music Player object");
refObj.AddComponent<MusicPlayer>();
MusicPlayer newMusPla = refObj.GetComponent<MusicPlayer>();
// Fetch/load the first MusicPlayer in the Resources folder
MusicPlayer[] musicPlayerResourceArray = (MusicPlayer[])Resources.FindObjectsOfTypeAll(typeof(MusicPlayer));
MusicPlayer defaultMusicPlayer = musicPlayerResourceArray[0];

// Warn
LogWarning("No MusicPlayer found in active scenes! A new (empty) one was created, but you probably don't want this", refObj);
return newMusPla;
// Check and warn if there are more than one MusicPlayer in the Resources folder (we don't control which one is loaded)
if (musicPlayerResourceArray.Length > 1)
{
LogWarning("Multiple MusicPlayer located in the Resource folder. Only the first found one will be used, remove the ones you do not wish to use.");
}

// Instantiate clone of MusicPlayer prefab
GameObject newMPGameObj = GameObject.Instantiate(defaultMusicPlayer.gameObject);
newMPGameObj.name = "Default Music Player";

// Find and return the MusicPlayer
MusicPlayer newMusicPlayer = newMPGameObj.GetComponent<MusicPlayer>();
return newMusicPlayer;
}
else // If no default resource can be found a new empty one will be instantiated instead to avoid null reference and a warning will be displayed
{
// Make a new gameobject and attach the music player to it
GameObject refObj = new GameObject("New Music Player object");
refObj.AddComponent<MusicPlayer>();
MusicPlayer newMusPla = refObj.GetComponent<MusicPlayer>();

// Warn
LogWarning("No MusicPlayer found in active scenes and default resource is missing! A new (empty) one was created, but you probably don't want this", refObj);
return newMusPla;
}
}
}
}

// TODO: Get all tracks
/// <summary>
/// Get all MusicTrack available in the current active MusicPlayer.
/// </summary>
/// <returns>List with all MusicTrack</returns>
public static List<MusicTrack> GetAllTracks()
{
return ActiveMusicPlayer.Tracks;
}
/// <summary>
/// Get all MusicTracks as strings. Has the same index as GetAllTracks and can be used to find index for a specific track.
/// </summary>
/// <returns>Array of all clips in active MusicPlayer</returns>
public static string[] GetAllTracksAsString()
{
List<string> trackStrings = new List<string>();
foreach (MusicTrack track in MusicController.GetAllTracks())
{
trackStrings.Add(track.ToString());
}
return trackStrings.ToArray();
}

// Play track
/// <summary>
@@ -59,7 +110,56 @@ public static void StopTrack()
ActiveMusicPlayer.StopTrack();
}

// TODO: Fade specific track
/// <summary>
/// Begins a crossfade of the specified track
/// </summary>
/// <param name="trackToFade">Which track should be crossfaded</param>
/// <param name="targetVolume">What volume the track should end up with</param>
/// <returns>Name of the track faded</returns>
public static string FadeTrack(MusicTrack trackToFade, float targetVolume = 0f)
{
ActiveMusicPlayer.BeginTrackFade(trackToFade, targetVolume);
return trackToFade.ToString();
}

/// <summary>
/// Begins a crossfade of the specified track
/// </summary>
/// <param name="trackToFade">Which track should be crossfaded</param>
/// <param name="targetVolume">What volume the track should end up with</param>
/// <param name="fadeDuration">Over how many seconds the fade will travel to the target volume</param>
/// <returns>Name of the track faded</returns>
public static string FadeTrack(MusicTrack trackToFade, float targetVolume = 0f, float fadeDuration = 0f)
{
ActiveMusicPlayer.BeginTrackFade(trackToFade, targetVolume, fadeDuration);
return trackToFade.ToString();
}

/// <summary>
/// Begins a crossfade of the specified track using it's index in the active MusicPlayer
/// </summary>
/// <param name="trackToFade">Which track should be crossfaded</param>
/// <param name="targetVolume">What volume the track should end up with</param>
/// <param name="fadeDuration">Over how many seconds the fade will travel to the target volume</param>
/// <returns>Name of the track faded</returns>
public static string FadeTrack(int trackToFade, float targetVolume = 0f)
{
// TODO: Resolve missing index
return FadeTrack(GetAllTracks()[trackToFade], targetVolume);
}

/// <summary>
/// Begins a crossfade of the specified track using it's index in the active MusicPlayer
/// </summary>
/// <param name="trackToFade">Which track should be crossfaded</param>
/// <param name="targetVolume">What volume the track should end up with</param>
/// <param name="fadeDuration">Over how many seconds the fade will travel to the target volume</param>
/// <returns>Name of the track faded</returns>
public static string FadeTrack(int trackToFade, float targetVolume, float fadeDuration)
{
// TODO: Resolve missing index
return FadeTrack(GetAllTracks()[trackToFade], targetVolume, fadeDuration);
}


/// <summary>
@@ -69,7 +169,7 @@ public static void StopTrack()
/// <param name="context">Defaults to the MusicPlayer</param>
static void LogWarning(string warningMessage, UnityEngine.Object context = null)
{
Debug.LogWarning("<color=darkblue><b>MusicController</b></color> - " + warningMessage, context);
Debug.LogWarning(debugPrefix + warningMessage, context);
}
}
}
@@ -3,23 +3,43 @@
using UnityEngine;
using MusicMixer;

class MusicControllerTester : MonoBehaviour {
public class MusicControllerTester : MonoBehaviour {

[SerializeField]
List<MusicTrack> trackCopy;
//[SerializeField]
//int trackIndex;
//[SerializeField]
//float testTimer = 5f;
//[SerializeField]
//bool didIt;

[Range(0,1)]
public float targetVolume = 0f;
public float fadeDuration = 0f;

//[SerializeField]
//List<MusicTrack> trackCopy;

// Use this for initialization
void Start () {
// Play first track
//MusicController.FadeTrack(MusicController.GetAllTracks()[0], 1f, 15);

//trackCopy = MusicController.GetAllTracks();
//Debug.Log("<color=cyan><b>MusicTester</b></color> - HAHA TESTING FORMATING: " + this.ToString(), this);
//if (MusicController.PlayTrack(trackCopy[0]))
//{
// Debug.LogWarning("<color=cyan><b>MusicTester</b></color> - I tried playing a track, and it worked!", this);
//}

// Use this for initialization
void Start () {
trackCopy = MusicController.GetAllTracks();
Debug.Log("<color=cyan><b>MusicTester</b></color> - HAHA TESTING FORMATING: " + this.ToString(), this);
if (MusicController.PlayTrack(trackCopy[0]))
{
Debug.LogWarning("<color=cyan><b>MusicTester</b></color> - I tried playing a track, and it worked!", this);
}

}

// Update is called once per frame
void Update () {
}
//// Update is called once per frame
//void Update () {
// if (Time.time > testTimer && !didIt)
// {
// MusicController.FadeTrack(MusicController.GetAllTracks()[trackIndex], targetVolume, fadeDuration);
// //trackCopy[0].StartFade(targetVolume, fadeDuration);
// didIt = true;
// }
// }
}
@@ -27,39 +27,22 @@ public class MusicPlayer : MonoBehaviour
[SerializeField]
private List<MusicTrack> tracks = new List<MusicTrack>();

[Header("Batch adding of tracks")]
[Header("Batch handling of tracks")]
[SerializeField]
public bool autoPopulateTracks;
private bool autoPopulateTracks;
[SerializeField]
private bool automaticRenaming;

private void Update()
{
AdjustTrackVolume();
}
[SerializeField]
float defaultFadeDuration;

private void AdjustTrackVolume()
{
// Iterate through trackList
foreach (MusicTrack track in tracks)
{
// Check if it's the correct volume
if (track.Volume != track.TargetVolume)
{
// Update fade function on track to continue fading
track.FadeTrackOverTime();
}
}
}
[Tooltip("Attempt to remove (UnityEngine.AudioClip) appended at the end of renamed children?")]
private bool trunctateNameOfRenamedTracks = true;

private void Awake()
{
CheckSingleton();
if (!startFadingIn)
{
foreach (MusicTrack track in tracks)
{
track.StopFadeTimer();
}
}
StartFadingIn();
}

private void CheckSingleton()
@@ -80,6 +63,36 @@ private void CheckSingleton()
}
}

private void StartFadingIn()
{
if (!startFadingIn)
{
foreach (MusicTrack track in tracks)
{
track.StopFadeTimer();
}
}
}
private void Update()
{
AdjustTrackVolume();
}

private void AdjustTrackVolume()
{
// Iterate through trackList
foreach (MusicTrack track in tracks)
{
// Check if it's the correct volume
if (track.Volume != track.TargetVolume)
{
// Update fade function on track to continue fading
track.FadeTrackOverTime();
}
}
}


/// <summary>
/// Fades the music track to the desired volume
/// </summary>
@@ -97,7 +110,7 @@ private void BeginTrackFade(MusicTrack track, float targetVolume = .0f)
/// <param name="track">Music track to fade</param>
/// <param name="targetVolume">Desired volume</param>
/// <param name="fadeDuration">New fade duration</param>
private void BeginTrackFade(MusicTrack track, float targetVolume = .0f, float fadeDuration = .0f)
public void BeginTrackFade(MusicTrack track, float targetVolume = .0f, float fadeDuration = .0f)
{
track.FadeDuration = fadeDuration;
BeginTrackFade(track, targetVolume);
@@ -107,7 +120,7 @@ private void BeginTrackFade(MusicTrack track, float targetVolume = .0f, float fa
/// Fades the music track to the previously set target volume
/// </summary>
/// <param name="track">Music track to fade</param>
private void BeginTrackFade(MusicTrack track)
public void BeginTrackFade(MusicTrack track)
{
BeginTrackFade(track, track.TargetVolume, track.FadeDuration);
}
@@ -280,6 +293,33 @@ private void OnValidate()
}
}

/// <summary>
/// Renames the game object to match the source file of the AudioSource
/// </summary>
public void RenameObjectsToSourceFile()
{
foreach (Transform child in transform.GetComponentsInChildren<Transform>())
{
if (child.GetComponent<AudioSource>())
{
string newName = child.GetComponent<AudioSource>().clip.ToString();
if (trunctateNameOfRenamedTracks)
{
newName = newName.Replace(" (UnityEngine.AudioClip)", "");
}
child.name = newName;
}
}
}

public void SetDefaultFadeDurationOnAllTracks()
{
foreach (MusicTrack track in tracks)
{
track.FadeDuration = defaultFadeDuration;
}
}

/// <summary>
/// Logs a debug warning message with unified formatting for MusicPlayer
/// </summary>
@@ -325,6 +365,22 @@ public List<MusicTrack> Tracks
return tracks;
}
}

public bool AutoPopulateTracks
{
get
{
return autoPopulateTracks;
}
}

public bool AutomaticRenaming
{
get
{
return automaticRenaming;
}
}
}

/// <summary>
@@ -340,8 +396,14 @@ public class MusicTrack
[SerializeField]
private AudioClip trackClip;

[ReadOnly]
[SerializeField]
private float currentVolume;

[SerializeField] [Range(0, 1)]
private float targetVolume = 0;
[SerializeField]
private float targetVolume, fadeDuration = 0;
private float fadeDuration = 0;

/// <summary>Monitors how long the track has been fading to new TargetVolume</summary>
private float fadeTimer;
@@ -418,7 +480,7 @@ public void StartFadeTimer()
{
// Reset fadeTime when a new target is set
fadeTimer = 0f;
Debug.Log("Reset fadetimer");
//Debug.Log("Reset fadetimer");
fadeStartVolume = Volume;
}

@@ -428,15 +490,29 @@ public void StopFadeTimer()
}

/// <summary>
/// Update track information. Mostly used for ReadOnly info
/// Update track information. Mostly used for ReadOnly info and only runs in editor
/// </summary>
public void UpdateEditorInfo()
{
#if UNITY_EDITOR
// Clip info
if (trackClip != trackSource.clip)
{
trackClip = trackSource.clip;
}

if (currentVolume != Volume)
{
currentVolume = Volume;
}
#endif
}

public override string ToString()
{
string trackName = trackClip.ToString();
trackName = trackName.Replace(" (UnityEngine.AudioClip)", "");
return trackName;
}

public float Volume

This file was deleted.

@@ -0,0 +1,142 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;

public class ButtonParameters : MonoBehaviour
{

[SerializeField]
UnityEvent ContinueEvent;

[SerializeField]
Item[] requiredItem;

[SerializeField]
bool destroyItemOnUse;

[SerializeField]
bool alwaysCheck;

[SerializeField]
bool requireInventoryRoom;

[SerializeField]
RequiredActivations[] requiredActivations;

public void OnClickParamaters()
{
if (requiredItem.Length >= 1)
{
for (int i = 0; i < requiredItem.Length; i++)
{
if (GameController.instance.SelectedItem == requiredItem[i])
{
if (requireInventoryRoom)
{
if (GameController.instance.GetCurrentCharacter().IsInventoryFull() == false)
{
ContinueEvent.Invoke();
}
}
else
{
ContinueEvent.Invoke();
}

if (destroyItemOnUse == true)
{
GameController.instance.GetCurrentCharacter().RemoveItemFromInventory(GameController.instance.SelectedItem);
GameController.instance.DeselectItem(GameController.instance.SelectedInventorySlot);
GameController.instance.UpdateInventory(GameController.instance.CurrentCharacterID);
}
}
}
}
else
{
if (requireInventoryRoom)
{
if (GameController.instance.GetCurrentCharacter().IsInventoryFull() == false)
{
Debug.Log("test");
ContinueEvent.Invoke();
}
}
else
{
ContinueEvent.Invoke();
}
}
}

public void Activate(Button button = null)
{
bool allComplete;
allComplete = Complete(button);
if (allComplete)
{
if (requireInventoryRoom)
{
if (GameController.instance.GetCurrentCharacter().IsInventoryFull() == false)
{
ContinueEvent.Invoke();
}
}
else
{
ContinueEvent.Invoke();
}

}
}

private bool Complete(Button button)
{
for (int i = 0; i < requiredActivations.Length; i++)
{
if (button == requiredActivations[i].requiredButton)
{
requiredActivations[i].activated = true;
}
}

for (int i = 0; i < requiredActivations.Length; i++)
{
if (requiredActivations[i].activated == false)
{
return false;
}

}
return true;
}

private void Update()
{
if (alwaysCheck)
{
CheckButtons();
}
}

private void CheckButtons()
{
for (int i = 0; i < requiredActivations.Length; i++)
{
if (requiredActivations[i].requiredButton.gameObject.activeInHierarchy)
{
requiredActivations[i].activated = true;
Activate();
}
else
{
requiredActivations[i].activated = false;
}
}
}
}

[System.Serializable]
public struct RequiredActivations { public Button requiredButton;[HideInInspector] public bool activated; }
@@ -1,7 +1,6 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

[RequireComponent(typeof(Camera))]
public class CameraFollow : MonoBehaviour
@@ -92,6 +91,11 @@ private void FollowTarget()
transform.position = new Vector3(pos.x + XAndYOffset.x, pos.y + XAndYOffset.y, transform.position.z);
}

public void SetPosition(Transform targetTransform)
{
transform.position = new Vector3(targetTransform.position.x, targetTransform.position.y, transform.position.z);
}

// Draw target idel area.
void OnDrawGizmos()
{
@@ -19,9 +19,6 @@ public class Character : Entity
[SerializeField]
float throwForce = 20f;

[SerializeField]
float itemPickupDistance = 3f;

[SerializeField]
int inventorySize;

@@ -204,9 +201,13 @@ public void SetActive(bool value)
isActive = value;

if (isActive)
{
animator.SetTrigger("toActiveIdle");
}
else
{
animator.SetTrigger("toInactiveIdle");
}

rb2D.velocity = new Vector2(0, rb2D.velocity.y);
}
@@ -219,14 +220,6 @@ public bool IsActive
}
}

public float ItemPickupDistance
{
get
{
return itemPickupDistance;
}
}

public bool HandsFree
{
get
@@ -244,4 +237,4 @@ public int GetItemCount()
{
return items.Count;
}
}
}
@@ -32,11 +32,16 @@ public ConditionValues IsAllComplete(EntityValues entityValues)
test = false;
}
}
if (container[i].isComplete == false && test == true)
if (container[i].isComplete == false && test && container[i].DialogueRunning == false)
{
container[i].isComplete = true;
values.dialogueNumber = container[i].dialogueDone;
values.meetComplete = true;
values.containerNumber = i;
container[i].dialogueDone++;
if (container[i].dialogueDone >= container[i].dialogue.Length)
{
container[i].isComplete = true;
}
return values;
}
else
@@ -48,6 +53,7 @@ public ConditionValues IsAllComplete(EntityValues entityValues)
}
}
values.meetComplete = false;
values.dialogueNumber = 0;
values.containerNumber = 0;
return values;
}
@@ -123,6 +129,7 @@ public struct ConditionValues
{
public bool meetComplete;
public int containerNumber;
public int dialogueNumber;
}

[System.Serializable]
@@ -131,7 +138,23 @@ public class ConditionContainer
[Tooltip("What conditions are required to trigger the dialogue.")]
public Conditions[] conditions;
[Tooltip("What dialogue is triggered.")]
public Dialogue dialogue;
public Dialogue[] dialogue;

[HideInInspector]
public int dialogueDone;
[HideInInspector]
bool dialogueRunning;
public bool isComplete;

public bool DialogueRunning
{
get
{
return dialogueRunning;
}
set
{
dialogueRunning = value;
}
}
}
@@ -5,7 +5,7 @@

public class DialogueController : MonoBehaviour
{
public enum Language { Svenska, English}
public enum Language { Svenska, English }

[Tooltip("Choose text gameobject.")]
[SerializeField]
@@ -20,6 +20,8 @@ public enum Language { Svenska, English}
GameObject currentSpeaker;
GameObject currentText;

bool dialogueRunning;

// Use this for initialization
void Start()
{
@@ -28,7 +30,10 @@ void Start()

public void RunDialogue(EntityValues entityValues)
{
StartCoroutine(CheckConditions(entityValues));
if (!dialogueRunning)
{
StartCoroutine(CheckConditions(entityValues));
}
}

//Checks all Conditions and returns the values of the first successful
@@ -37,25 +42,26 @@ private IEnumerator CheckConditions(EntityValues entityValues)
ConditionValues values = conditionsManager.CheckConditions(entityValues);
if (values.meetComplete == true)
{
for (int j = 0; j < conditionsManager.container[values.containerNumber].dialogue.dialogue.Length; j++)
for (int j = 0; j < conditionsManager.container[values.containerNumber].dialogue[values.dialogueNumber].dialogue.Length; j++)
{
StartCoroutine( DisplayDialogue(conditionsManager.container[values.containerNumber].dialogue.dialogue[j],
conditionsManager.container[values.containerNumber].dialogue.dialogue[j].time) );
yield return new WaitForSeconds(conditionsManager.container[values.containerNumber].dialogue.dialogue[j].time);
StartCoroutine(DisplayDialogue(conditionsManager.container[values.containerNumber].dialogue[values.dialogueNumber].dialogue[j],
conditionsManager.container[values.containerNumber].dialogue[values.dialogueNumber].dialogue[j].time, values));
yield return new WaitForSeconds(conditionsManager.container[values.containerNumber].dialogue[values.dialogueNumber].dialogue[j].time);
print(j.ToString());
}

}
}

//Displays current dialogue and sets current source
private IEnumerator DisplayDialogue(DialogueElements dialogue, float time)
private IEnumerator DisplayDialogue(DialogueElements dialogue, float time, ConditionValues values)
{
conditionsManager.container[values.containerNumber].DialogueRunning = true;
GameObject textGameobject = Instantiate(dialogueTextPrefab, new Vector3(0, 0), transform.rotation, dialogue.speaker.transform);
Text dialogueText = textGameobject.GetComponentInChildren<Text>();
currentText = textGameobject;
currentSpeaker = dialogue.speaker;
if(language == Language.Svenska)
if (language == Language.Svenska)
{
dialogueText.text = dialogue.line_Swedish;
dialogueText.font.material.mainTexture.filterMode = FilterMode.Point;
@@ -67,15 +73,16 @@ private IEnumerator DisplayDialogue(DialogueElements dialogue, float time)
}
yield return new WaitForSeconds(time);
Destroy(textGameobject);
conditionsManager.container[values.containerNumber].DialogueRunning = false;
}

private void DialoguePosition()
{
if (currentSpeaker != null && currentText != null)
{
Vector3 screenpos;
screenpos = Camera.main.GetComponent<Camera>().WorldToViewportPoint( currentSpeaker.transform.position + textPosition );
currentText.transform.GetChild(0).transform.position = Camera.main.GetComponent<Camera>().WorldToScreenPoint( currentSpeaker.transform.position + textPosition );
screenpos = Camera.main.GetComponent<Camera>().WorldToViewportPoint(currentSpeaker.transform.position + textPosition);
currentText.transform.GetChild(0).transform.position = Camera.main.GetComponent<Camera>().WorldToScreenPoint(currentSpeaker.transform.position + textPosition);
}
}

@@ -1,73 +1,62 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEditor;
using UnityEngine.UI;

public class Door : Entity
{

[Header("> Door")]

[Tooltip("The other door this one leads to.")]
[SerializeField]
Door exitDoor;

[Tooltip("Is the Door locked?")]
[SerializeField]
bool doorLocked;

[Tooltip("Item that can activate the lock")]
[SerializeField]
Item key;

[Tooltip("The minumum distance a character has to be from the door to open it.")]
[SerializeField]
float minRadiusDistance = 1;

[SerializeField]
float transitionTime = 1;

protected override void OnInteract(EntityValues values)
{
float distance = Vector2.Distance(values.character.transform.position, transform.position);
if (distance <= minRadiusDistance && doorLocked == false)
{
StartCoroutine(EnterDoor(values.character));

values.trigger = EntityValues.TriggerType.EnterDoor;
base.OnInteract(values);
}
else if (distance <= minRadiusDistance && doorLocked == true)
{
values.trigger = EntityValues.TriggerType.UseItem;
base.OnInteract(values);

SetLock(false, values.item);
}
}

private IEnumerator EnterDoor(Character character)
{
StartCoroutine(Fade.FadeIn(transitionTime));
yield return new WaitForSeconds(transitionTime);
float characterHeight = character.GetComponent<CapsuleCollider2D>().size.y;
float doorHeight = exitDoor.GetComponent<BoxCollider2D>().size.y;
character.transform.position = new Vector2(exitDoor.transform.position.x, exitDoor.transform.position.y - doorHeight + characterHeight);
}

public void SetLock(bool value, Item item)
{
if (item == key)
{
doorLocked = value;
}
}

private void OnDrawGizmos()
{
UnityEditor.Handles.color = Color.green;
UnityEditor.Handles.DrawWireDisc(transform.position, Vector3.forward, minRadiusDistance);
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

public class Door : Entity
{

[Header("> Door")]

[Tooltip("The other door this one leads to.")]
[SerializeField]
Door exitDoor;

[Tooltip("Is the Door locked?")]
[SerializeField]
bool doorLocked;

[Tooltip("Item that can activate the lock")]
[SerializeField]
Item key;

[SerializeField]
float transitionTime = 1;

protected override void OnInteract(EntityValues values)
{
if (doorLocked == false)
{
StartCoroutine(EnterDoor(values.character));

values.trigger = EntityValues.TriggerType.EnterDoor;
base.OnInteract(values);
}
else if (doorLocked == true)
{
values.trigger = EntityValues.TriggerType.UseItem;
base.OnInteract(values);

if (values.item != null && values.item == key)
{
SetLock(false);
}
}
}

private IEnumerator EnterDoor(Character character)
{
StartCoroutine(Fade.FadeIn(transitionTime));
yield return new WaitForSeconds(transitionTime);
float characterHeight = character.GetComponent<CapsuleCollider2D>().size.y;
float doorHeight = exitDoor.GetComponent<BoxCollider2D>().size.y;
character.transform.position = new Vector2(exitDoor.transform.position.x, exitDoor.transform.position.y - doorHeight + characterHeight);
}

public void SetLock(bool value)
{

doorLocked = value;
}
}
@@ -2,7 +2,9 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
#if UNITY_EDITOR
using UnityEditor;
#endif

[RequireComponent(typeof(Collider2D))]
public class Entity : MonoBehaviour
@@ -13,13 +15,18 @@ public class Entity : MonoBehaviour
[SerializeField]
string entityName;

[Tooltip("The minumum distance a character has to be from the entity to interact with it.")]
[SerializeField]
float interactDistance = 1f;

[SerializeField]
protected CanUseCondition canUseCondition;

[SerializeField]
ValueEvent interactionEvents;
[Tooltip("If the Character is not allowed to use the entity this event will be called on interaction")]
[SerializeField]
ValueEvent inspectEvents;
ValueEvent cantUseEvents;

bool canBeInteractedWith;

@@ -36,7 +43,7 @@ public void Interact(EntityValues values)
else if (canUseCondition.CanInteract(values.character) == false)
{
values.trigger = EntityValues.TriggerType.Inspect;
OnInspect(values);
OnCantUse(values);
}
}

@@ -49,9 +56,9 @@ protected virtual void OnInteract(EntityValues values)
interactionEvents.Invoke(values);
}

protected virtual void OnInspect(EntityValues values)
protected virtual void OnCantUse(EntityValues values)
{
inspectEvents.Invoke(values);
cantUseEvents.Invoke(values);
}

public string EntityName
@@ -62,6 +69,14 @@ public string EntityName
}
}

public float InteractDistance
{
get
{
return interactDistance;
}
}

public ValueEvent InteractionEvents
{
get
@@ -74,6 +89,13 @@ public ValueEvent InteractionEvents
interactionEvents = value;
}
}
#if UNITY_EDITOR
private void OnDrawGizmos()
{
UnityEditor.Handles.color = Color.blue;
UnityEditor.Handles.DrawWireDisc(transform.position, Vector3.forward, interactDistance);
}
#endif
}

[System.Serializable]
@@ -115,6 +137,7 @@ public bool CanInteract(Character character)
}
}

#if UNITY_EDITOR
[CustomPropertyDrawer(typeof(CanUseCondition))]
public class CanUseConditionDrawer : PropertyDrawer
{
@@ -155,6 +178,7 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
}
}
}
#endif

[System.Serializable]
public class ValueEvent : UnityEvent<EntityValues> { }
@@ -4,7 +4,7 @@
using UnityEngine.UI;
using UnityEngine.Events;

struct InventorySlot
public struct InventorySlot
{
public Item item;
public GameObject slot;
@@ -66,6 +66,9 @@ public Camera CameraComponent
[SerializeField]
GameObject inventorySlotPrefab;

[SerializeField]
bool isActive;


/// <summary>
/// The entity that the mouse is hovering over.
@@ -142,7 +145,7 @@ private void Update()
{
// Deselect item on click.
hoverImageObject.transform.position = Input.mousePosition;
if (Input.GetButtonDown("Interact") && isHoldingItem)
if (Input.GetButtonDown("Interact") && isHoldingItem && isActive)
{
if (hoverEntity == false)
{
@@ -209,7 +212,7 @@ private void RaycastSelect()

// Interact
float distance = (entity.transform.position - currentCharacter.transform.position).magnitude;
if (Input.GetButtonDown("Interact") && distance <= currentCharacter.ItemPickupDistance)
if (Input.GetButtonDown("Interact") && distance <= entity.InteractDistance)
{
InteractWithEntity(entity);
}
@@ -264,6 +267,8 @@ private void ChangeCharacter(int charID)
currentCharacter = characters[currentCharID];

currentCharacter.SetActive(true);
cameraComponent.GetComponent<CameraFollow>().Target = currentCharacter.transform;
cameraComponent.GetComponent<CameraFollow>().SetPosition(currentCharacter.transform);

// TODO: Do stuff with camera
}
@@ -281,10 +286,18 @@ public void SetInventoryItems(List<Item> items)
}
}

public void AddItemToCurrentCharacter(Item item)
{
if (currentCharacter.IsInventoryFull() == false)
{
currentCharacter.AddItemToInventory(item);
}
}

/// <summary>
/// Resets and sets the the UI inventory slots to match the given character's.
/// </summary>
private void UpdateInventory(int charID)
public void UpdateInventory(int charID)
{
foreach (InventorySlot inventorySlot in inventorySlots[currentCharID])
{
@@ -364,7 +377,7 @@ private void SelectItem(InventorySlot slot)
/// <summary>
/// Deselects and item when you drop it or try to interact with someting.
/// </summary>
private void DeselectItem(InventorySlot slot)
public void DeselectItem(InventorySlot slot)
{
isHoldingItem = false;

@@ -386,7 +399,32 @@ public Character GetCurrentCharacter()
/// </summary>
public void SetActiveMovement(bool value)
{
isActive = value;
canChangeChar = value;
currentCharacter.SetActive(value);
}

public Item SelectedItem
{
get
{
return selectedInventorySlot.item;
}
}

public InventorySlot SelectedInventorySlot
{
get
{
return selectedInventorySlot;
}
}

public int CurrentCharacterID
{
get
{
return currentCharID;
}
}
}
@@ -0,0 +1,45 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

static public class GlobalStatics
{
const ELanguage DEFAULT_LANGUAGE = ELanguage.Swedish;

/// <summary>
/// What localisation/language to use for text
/// </summary>
private static ELanguage language;

/// <summary>
/// What localisation/language to use for text
/// </summary>
public static ELanguage Language
{
get
{
switch (language)
{
case ELanguage.English:
return language;

case ELanguage.Swedish:
return language;

default:
return DEFAULT_LANGUAGE;
}
}

set
{
language = value;
}
}
}

public enum ELanguage
{
English,
Swedish
}
@@ -2,7 +2,7 @@
using System.Collections.Generic;
using UnityEngine;

public class Ida : MonoBehaviour
public class Ida : Character
{
// Use this for initialization
void Start ()
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using UnityEngine;

[RequireComponent(typeof(Rigidbody2D))]
public class Item : Entity
{
[SerializeField]
@@ -2,7 +2,7 @@
using System.Collections.Generic;
using UnityEngine;

public class Jonathan : MonoBehaviour
public class Jonathan : Character
{

// Use this for initialization
@@ -6,6 +6,8 @@ public class PuzzleScreenController : MonoBehaviour
{
GameObject[] puzzleScreens;

List<int> deactivatedId = new List<int>();

private void Awake()
{
puzzleScreens = new GameObject[transform.childCount];
@@ -18,12 +20,43 @@ private void Awake()
}

/// <summary>
/// Sets if the given screen is active or not.
/// Activates the given screen.
/// </summary>
/// <param name="id">The id of the screen.</param>
public void ActivateScreen(int id)
{
if (!deactivatedId.Contains(id))
{
puzzleScreens[id].SetActive(true);
GameController.instance.SetActiveMovement(false);
}
}

/// <summary>
/// Deactivates the given screen.
/// </summary>
/// <param name="id">The id of the screen.</param>
public void SetActiveScreen(int id, bool value)
public void DeactivateScreen(int id)
{
puzzleScreens[id].SetActive(value);
GameController.instance.SetActiveMovement(value);

puzzleScreens[id].SetActive(false);
GameController.instance.SetActiveMovement(true);
}

public void PermenentDeactivate(int id)
{
deactivatedId.Add(id);
}

private void Update()
{
if (Input.GetButtonDown("Cancel"))
{
for (int i = 0; i < puzzleScreens.Length; i++)
{
puzzleScreens[i].SetActive(false);
}
GameController.instance.SetActiveMovement(true);
}
}
}
@@ -0,0 +1,23 @@
/// Read Only Attribute - https://gist.github.com/MattRix/9fb45606bfbc16254641e4d462117737

using UnityEngine;
using System;
using System.Reflection;
using System.Text.RegularExpressions;

[AttributeUsage (AttributeTargets.Field,Inherited = true)]
public class ReadOnlyAttribute : PropertyAttribute {}

#if UNITY_EDITOR
[UnityEditor.CustomPropertyDrawer (typeof(ReadOnlyAttribute))]
public class ReadOnlyAttributeDrawer : UnityEditor.PropertyDrawer
{
public override void OnGUI(Rect rect, UnityEditor.SerializedProperty prop, GUIContent label)
{
bool wasEnabled = GUI.enabled;
GUI.enabled = false;
UnityEditor.EditorGUI.PropertyField(rect,prop);
GUI.enabled = wasEnabled;
}
}
#endif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Deleted file not rendered
Deleted file not rendered
Deleted file not rendered
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Deleted file not rendered
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Deleted file not rendered

This file was deleted.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.