From 5ca32b3ea3b2af1b23de6b5ca2b1528203a34ba4 Mon Sep 17 00:00:00 2001 From: EmirHanMamak Date: Sat, 28 Feb 2026 20:19:44 +0300 Subject: [PATCH] feat(Observer Pattern): Add interface-based basic example --- .../01_BasicExample_WithoutEvent.unity | 882 ++++++++++++++++++ .../01_BasicExample_WithoutEvent.unity.meta | 7 + .../Script/01_BasicExample/Interface.meta | 3 + .../01_BasicExample/Interface/IObserver.cs | 7 + .../Interface/IObserver.cs.meta | 3 + .../01_BasicExample/Interface/ISubject.cs | 9 + .../Interface/ISubject.cs.meta | 3 + .../Script/01_BasicExample/Observer.cs | 34 + .../Script/01_BasicExample/Observer.cs.meta | 3 + .../Script/01_BasicExample/Observer2.cs | 34 + .../Script/01_BasicExample/Observer2.cs.meta | 3 + .../Script/01_BasicExample/Subject.cs | 38 + .../Script/01_BasicExample/Subject.cs.meta | 3 + .../02_RealWorldUsage/Abstract/Subject.cs | 5 +- .../02_RealWorldUsage/ClientObserver.cs | 1 + .../Subject/BikeController.cs | 1 + UserSettings/EditorUserSettings.asset | 3 + UserSettings/Layouts/default-6000.dwlt | 335 +++---- 18 files changed, 1206 insertions(+), 168 deletions(-) create mode 100644 Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Scene/01_BasicExample/01_BasicExample_WithoutEvent.unity create mode 100644 Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Scene/01_BasicExample/01_BasicExample_WithoutEvent.unity.meta create mode 100644 Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Interface.meta create mode 100644 Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Interface/IObserver.cs create mode 100644 Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Interface/IObserver.cs.meta create mode 100644 Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Interface/ISubject.cs create mode 100644 Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Interface/ISubject.cs.meta create mode 100644 Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Observer.cs create mode 100644 Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Observer.cs.meta create mode 100644 Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Observer2.cs create mode 100644 Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Observer2.cs.meta create mode 100644 Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Subject.cs create mode 100644 Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Subject.cs.meta diff --git a/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Scene/01_BasicExample/01_BasicExample_WithoutEvent.unity b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Scene/01_BasicExample/01_BasicExample_WithoutEvent.unity new file mode 100644 index 0000000..35b6903 --- /dev/null +++ b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Scene/01_BasicExample/01_BasicExample_WithoutEvent.unity @@ -0,0 +1,882 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 10 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 1 + m_PVRFilteringGaussRadiusAO: 1 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &178921307 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 178921311} + - component: {fileID: 178921310} + - component: {fileID: 178921309} + - component: {fileID: 178921308} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &178921308 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 178921307} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &178921309 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 178921307} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0.5 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!223 &178921310 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 178921307} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_VertexColorAlwaysGammaSpace: 0 + m_AdditionalShaderChannelsFlag: 25 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &178921311 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 178921307} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1311607723} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!1 &317155085 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 317155086} + - component: {fileID: 317155087} + m_Layer: 0 + m_Name: Subject + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &317155086 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 317155085} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &317155087 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 317155085} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 640ba1e7e68e4944a75083374afc0bfb, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &633334822 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 633334825} + - component: {fileID: 633334824} + - component: {fileID: 633334823} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &633334823 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 633334822} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 01614664b831546d2ae94a42149d80ac, type: 3} + m_Name: + m_EditorClassIdentifier: + m_SendPointerHoverToParent: 1 + m_MoveRepeatDelay: 0.5 + m_MoveRepeatRate: 0.1 + m_XRTrackingOrigin: {fileID: 0} + m_ActionsAsset: {fileID: -944628639613478452, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_PointAction: {fileID: -1654692200621890270, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_MoveAction: {fileID: -8784545083839296357, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_SubmitAction: {fileID: 392368643174621059, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_CancelAction: {fileID: 7727032971491509709, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_LeftClickAction: {fileID: 3001919216989983466, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_MiddleClickAction: {fileID: -2185481485913320682, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_RightClickAction: {fileID: -4090225696740746782, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_ScrollWheelAction: {fileID: 6240969308177333660, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_TrackedDevicePositionAction: {fileID: 6564999863303420839, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_TrackedDeviceOrientationAction: {fileID: 7970375526676320489, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_DeselectOnBackgroundClick: 1 + m_PointerBehavior: 0 + m_CursorLockBehavior: 0 + m_ScrollDeltaPerTick: 6 +--- !u!114 &633334824 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 633334822} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 10 +--- !u!4 &633334825 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 633334822} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &709525733 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 709525734} + - component: {fileID: 709525737} + - component: {fileID: 709525736} + - component: {fileID: 709525735} + m_Layer: 5 + m_Name: SendObserver_Button + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &709525734 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 709525733} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 723379235} + m_Father: {fileID: 1311607723} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &709525735 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 709525733} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 709525736} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 317155087} + m_TargetAssemblyTypeName: Patterns_And_Principles.Patterns.The_Observer_Pattern.WithoutEvent.Script._01_BasicExample.Subject, + Assembly-CSharp + m_MethodName: NotifyObservers + 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!114 &709525736 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 709525733} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &709525737 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 709525733} + m_CullTransparentMesh: 1 +--- !u!1 &723379234 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 723379235} + - component: {fileID: 723379237} + - component: {fileID: 723379236} + m_Layer: 5 + m_Name: SendObserver_Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &723379235 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 723379234} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 709525734} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -30, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &723379236 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 723379234} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: Send Observer + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4281479730 + m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 72 + m_fontSizeBase: 24 + m_fontWeight: 400 + m_enableAutoSizing: 1 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_TextWrappingMode: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 0 + m_ActiveFontFeatures: 6e72656b + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_EmojiFallbackSupport: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &723379237 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 723379234} + m_CullTransparentMesh: 1 +--- !u!1 &1001003873 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1001003876} + - component: {fileID: 1001003875} + - component: {fileID: 1001003874} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &1001003874 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1001003873} + m_Enabled: 1 +--- !u!20 &1001003875 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1001003873} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1001003876 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1001003873} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1311607722 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1311607723} + - component: {fileID: 1311607725} + - component: {fileID: 1311607724} + m_Layer: 5 + m_Name: Panel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1311607723 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1311607722} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 709525734} + m_Father: {fileID: 178921311} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 600, y: 500} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1311607724 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1311607722} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.8301887, g: 0, b: 0, a: 0.85882354} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1311607725 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1311607722} + m_CullTransparentMesh: 1 +--- !u!1 &1426944358 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1426944360} + - component: {fileID: 1426944359} + m_Layer: 0 + m_Name: Observer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1426944359 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1426944358} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fb4cff4763604a049288e93a158de7a7, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &1426944360 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1426944358} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1763845187 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1763845189} + - component: {fileID: 1763845188} + m_Layer: 0 + m_Name: Observer2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1763845188 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1763845187} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4feb73425b2a41d4a248339ce74e50cd, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &1763845189 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1763845187} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 1001003876} + - {fileID: 178921311} + - {fileID: 633334825} + - {fileID: 317155086} + - {fileID: 1426944360} + - {fileID: 1763845189} diff --git a/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Scene/01_BasicExample/01_BasicExample_WithoutEvent.unity.meta b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Scene/01_BasicExample/01_BasicExample_WithoutEvent.unity.meta new file mode 100644 index 0000000..acff453 --- /dev/null +++ b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Scene/01_BasicExample/01_BasicExample_WithoutEvent.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b8ce879b8b728664e93212e94b9893f6 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Interface.meta b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Interface.meta new file mode 100644 index 0000000..24d9324 --- /dev/null +++ b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Interface.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 8490c08fc0254778b332676f8eecd5a1 +timeCreated: 1772292150 \ No newline at end of file diff --git a/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Interface/IObserver.cs b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Interface/IObserver.cs new file mode 100644 index 0000000..f654ea3 --- /dev/null +++ b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Interface/IObserver.cs @@ -0,0 +1,7 @@ +namespace Patterns_And_Principles.Patterns.The_Observer_Pattern.WithoutEvent.Script._01_BasicExample.Interface +{ + public interface IObserver + { + public void Notify(ISubject subject); + } +} \ No newline at end of file diff --git a/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Interface/IObserver.cs.meta b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Interface/IObserver.cs.meta new file mode 100644 index 0000000..8f19ebc --- /dev/null +++ b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Interface/IObserver.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 91e73992c3cc44c0945f774c1649dc6f +timeCreated: 1772292185 \ No newline at end of file diff --git a/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Interface/ISubject.cs b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Interface/ISubject.cs new file mode 100644 index 0000000..c190f40 --- /dev/null +++ b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Interface/ISubject.cs @@ -0,0 +1,9 @@ +namespace Patterns_And_Principles.Patterns.The_Observer_Pattern.WithoutEvent.Script._01_BasicExample.Interface +{ + public interface ISubject + { + public void Attach(IObserver observer); + public void Detach(IObserver observer); + public void NotifyObservers(); + } +} \ No newline at end of file diff --git a/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Interface/ISubject.cs.meta b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Interface/ISubject.cs.meta new file mode 100644 index 0000000..4282b2b --- /dev/null +++ b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Interface/ISubject.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f34f0d523fdc43a7aae1e3b7d9c68740 +timeCreated: 1772292204 \ No newline at end of file diff --git a/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Observer.cs b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Observer.cs new file mode 100644 index 0000000..fbd7899 --- /dev/null +++ b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Observer.cs @@ -0,0 +1,34 @@ +using System; +using Patterns_And_Principles.Patterns.The_Observer_Pattern.WithoutEvent.Script._01_BasicExample.Interface; +using UnityEngine; + +namespace Patterns_And_Principles.Patterns.The_Observer_Pattern.WithoutEvent.Script._01_BasicExample +{ + public class Observer : MonoBehaviour, IObserver + { + private Subject _subject; + + private void OnEnable() + { + _subject.Attach(this); + } + + private void OnDisable() + { + _subject.Detach(this); + } + + private void Awake() + { + _subject = FindObjectOfType(); + } + + public void Notify(ISubject subject) + { + if (subject != null) + { + Debug.Log("Observer Notify"); + } + } + } +} \ No newline at end of file diff --git a/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Observer.cs.meta b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Observer.cs.meta new file mode 100644 index 0000000..d91525a --- /dev/null +++ b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Observer.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: fb4cff4763604a049288e93a158de7a7 +timeCreated: 1772292396 \ No newline at end of file diff --git a/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Observer2.cs b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Observer2.cs new file mode 100644 index 0000000..ad4d2f2 --- /dev/null +++ b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Observer2.cs @@ -0,0 +1,34 @@ +using System; +using Patterns_And_Principles.Patterns.The_Observer_Pattern.WithoutEvent.Script._01_BasicExample.Interface; +using UnityEngine; + +namespace Patterns_And_Principles.Patterns.The_Observer_Pattern.WithoutEvent.Script._01_BasicExample +{ + public class Observer2 : MonoBehaviour, IObserver + { + private Subject _subject; + + private void OnEnable() + { + _subject.Attach(this); + } + + private void OnDisable() + { + _subject.Detach(this); + } + + private void Awake() + { + _subject = FindObjectOfType(); + } + + public void Notify(ISubject subject) + { + if (subject != null) + { + Debug.Log("Observer2 Notify"); + } + } + } +} \ No newline at end of file diff --git a/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Observer2.cs.meta b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Observer2.cs.meta new file mode 100644 index 0000000..39a5129 --- /dev/null +++ b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Observer2.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 4feb73425b2a41d4a248339ce74e50cd +timeCreated: 1772293634 \ No newline at end of file diff --git a/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Subject.cs b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Subject.cs new file mode 100644 index 0000000..37cfd26 --- /dev/null +++ b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Subject.cs @@ -0,0 +1,38 @@ +using System.Collections.Generic; +using Patterns_And_Principles.Patterns.The_Observer_Pattern.WithoutEvent.Script._01_BasicExample.Interface; +using UnityEngine; + +namespace Patterns_And_Principles.Patterns.The_Observer_Pattern.WithoutEvent.Script._01_BasicExample +{ + public class Subject : MonoBehaviour, ISubject + { + private readonly List _observers = new List(); + + public void Attach(IObserver observer) + { + _observers.Add(observer); + } + + public void Detach(IObserver observer) + { + _observers.Remove(observer); + } + + public void NotifyObservers() + { + foreach (var observer in _observers) + { + observer.Notify(this); + } + } + private void Update() + { + // Press Space to trigger notification + if (Input.GetKeyDown(KeyCode.Space)) + { + Debug.Log("Subject triggered!"); + NotifyObservers(); + } + } + } +} \ No newline at end of file diff --git a/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Subject.cs.meta b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Subject.cs.meta new file mode 100644 index 0000000..41ac9d9 --- /dev/null +++ b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/01_BasicExample/Subject.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 640ba1e7e68e4944a75083374afc0bfb +timeCreated: 1772292380 \ No newline at end of file diff --git a/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/02_RealWorldUsage/Abstract/Subject.cs b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/02_RealWorldUsage/Abstract/Subject.cs index 7e85b78..a215163 100644 --- a/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/02_RealWorldUsage/Abstract/Subject.cs +++ b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/02_RealWorldUsage/Abstract/Subject.cs @@ -1,20 +1,23 @@ using System.Collections; +using System.Collections.Generic; using UnityEngine; namespace Patterns_And_Principles.Patterns.The_Observer_Pattern.WithoutEvent.Script._02_RealWorldUsage.Abstract { public abstract class Subject : MonoBehaviour { - private readonly ArrayList _observers = new ArrayList(); + private readonly List _observers = new List(); public void Attach(Observer observer) { _observers.Add(observer); } + public void Detach(Observer observer) { _observers.Remove(observer); } + public void NotifyObservers() { foreach (Observer observer in _observers) diff --git a/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/02_RealWorldUsage/ClientObserver.cs b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/02_RealWorldUsage/ClientObserver.cs index 9ca6e3d..341b1ed 100644 --- a/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/02_RealWorldUsage/ClientObserver.cs +++ b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/02_RealWorldUsage/ClientObserver.cs @@ -22,6 +22,7 @@ namespace Patterns_And_Principles.Patterns.The_Observer_Pattern.WithoutEvent.Scr _bikeController.TakeDamage(15f); } } + if (GUILayout.Button("Toggle Turbo")) { if (_bikeController) diff --git a/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/02_RealWorldUsage/Subject/BikeController.cs b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/02_RealWorldUsage/Subject/BikeController.cs index 24a2298..219154c 100644 --- a/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/02_RealWorldUsage/Subject/BikeController.cs +++ b/Assets/Patterns_And_Principles/Patterns/The Observer Pattern/WithoutEvent/Script/02_RealWorldUsage/Subject/BikeController.cs @@ -69,6 +69,7 @@ namespace Patterns_And_Principles.Patterns.The_Observer_Pattern.WithoutEvent.Scr { IsTurboOn = !IsTurboOn; } + NotifyObservers(); } diff --git a/UserSettings/EditorUserSettings.asset b/UserSettings/EditorUserSettings.asset index df03f18..91ee077 100644 --- a/UserSettings/EditorUserSettings.asset +++ b/UserSettings/EditorUserSettings.asset @@ -20,6 +20,9 @@ EditorUserSettings: RecentlyUsedSceneGuid-3: value: 5303045607030b5f5b0c0a2313275a444315492f2d7e24627a2f1f36b7b53260 flags: 0 + RecentlyUsedSceneGuid-4: + value: 010957035d025059550c5b7048750944134e4b787d7a2369792b446bbbb3326e + flags: 0 lightmappingBakingProfile: value: 51 flags: 0 diff --git a/UserSettings/Layouts/default-6000.dwlt b/UserSettings/Layouts/default-6000.dwlt index 6a5e264..8525e56 100644 --- a/UserSettings/Layouts/default-6000.dwlt +++ b/UserSettings/Layouts/default-6000.dwlt @@ -19,7 +19,7 @@ MonoBehaviour: width: 1920 height: 989 m_ShowMode: 4 - m_Title: Hierarchy + m_Title: Game m_RootView: {fileID: 6} m_MinSize: {x: 875, y: 300} m_MaxSize: {x: 10000, y: 10000} @@ -41,13 +41,13 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 0 - width: 404 + width: 1043 height: 933 m_MinSize: {x: 201, y: 226} m_MaxSize: {x: 4001, y: 4026} - m_ActualView: {fileID: 22} + m_ActualView: {fileID: 23} m_Panes: - - {fileID: 22} + - {fileID: 23} m_Selected: 0 m_LastSelected: 0 --- !u!114 &3 @@ -67,7 +67,7 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 535 - width: 452 + width: 224 height: 398 m_MinSize: {x: 102, y: 126} m_MaxSize: {x: 4002, y: 4026} @@ -94,9 +94,9 @@ MonoBehaviour: m_Position: serializedVersion: 2 x: 0 - y: 531 - width: 683 - height: 402 + y: 363 + width: 272 + height: 570 m_MinSize: {x: 232, y: 276} m_MaxSize: {x: 10002, y: 10026} m_ActualView: {fileID: 21} @@ -121,14 +121,14 @@ MonoBehaviour: - {fileID: 4} m_Position: serializedVersion: 2 - x: 856 + x: 1267 y: 0 - width: 683 + width: 272 height: 933 m_MinSize: {x: 100, y: 100} m_MaxSize: {x: 8096, y: 16192} vertical: 1 - controlID: 93 + controlID: 77 draggingID: 0 --- !u!114 &6 MonoBehaviour: @@ -206,7 +206,7 @@ MonoBehaviour: m_MinSize: {x: 400, y: 100} m_MaxSize: {x: 32384, y: 16192} vertical: 0 - controlID: 126 + controlID: 39 draggingID: 0 --- !u!114 &9 MonoBehaviour: @@ -246,9 +246,9 @@ MonoBehaviour: - {fileID: 3} m_Position: serializedVersion: 2 - x: 404 + x: 1043 y: 0 - width: 452 + width: 224 height: 933 m_MinSize: {x: 100, y: 100} m_MaxSize: {x: 8096, y: 16192} @@ -272,8 +272,8 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 0 - width: 683 - height: 531 + width: 272 + height: 363 m_MinSize: {x: 202, y: 226} m_MaxSize: {x: 4002, y: 4026} m_ActualView: {fileID: 19} @@ -325,13 +325,13 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 0 - width: 452 + width: 224 height: 535 m_MinSize: {x: 202, y: 226} m_MaxSize: {x: 4002, y: 4026} - m_ActualView: {fileID: 23} + m_ActualView: {fileID: 22} m_Panes: - - {fileID: 23} + - {fileID: 22} - {fileID: 15} m_Selected: 0 m_LastSelected: 1 @@ -490,7 +490,7 @@ MonoBehaviour: m_PaneScroll: {x: 0, y: 0} m_ViewType: 1 updateViewLive: 0 - m_CurrentFrameIndex: 315 + m_CurrentFrameIndex: -1 m_HierarchyOverruledThreadFromSelection: 0 m_ProfilerViewFilteringOptions: 1 m_FrameDataHierarchyView: @@ -639,7 +639,7 @@ MonoBehaviour: (Press ''F'' for frame selection)' - m_TextWithWhitespace: + m_TextWithWhitespace: "Called From\u200B" contextMenuText: headerTextAlignment: 0 sortingArrowAlignment: 2 @@ -655,7 +655,7 @@ MonoBehaviour: m_Text: Calls m_Image: {fileID: 0} m_Tooltip: Total number of calls in a selected frame - m_TextWithWhitespace: + m_TextWithWhitespace: "Calls\u200B" contextMenuText: headerTextAlignment: 0 sortingArrowAlignment: 2 @@ -671,7 +671,7 @@ MonoBehaviour: m_Text: GC Alloc m_Image: {fileID: 0} m_Tooltip: - m_TextWithWhitespace: + m_TextWithWhitespace: "GC Alloc\u200B" contextMenuText: headerTextAlignment: 0 sortingArrowAlignment: 2 @@ -687,7 +687,7 @@ MonoBehaviour: m_Text: Time ms m_Image: {fileID: 0} m_Tooltip: Total time the selected function spends within a parent - m_TextWithWhitespace: + m_TextWithWhitespace: "Time ms\u200B" contextMenuText: headerTextAlignment: 0 sortingArrowAlignment: 2 @@ -704,7 +704,7 @@ MonoBehaviour: m_Image: {fileID: 0} m_Tooltip: Shows how often the selected function was called from the parent call - m_TextWithWhitespace: + m_TextWithWhitespace: "Time %\u200B" contextMenuText: headerTextAlignment: 0 sortingArrowAlignment: 2 @@ -752,7 +752,7 @@ MonoBehaviour: (Press ''F'' for frame selection)' - m_TextWithWhitespace: + m_TextWithWhitespace: "Called From\u200B" contextMenuText: headerTextAlignment: 0 sortingArrowAlignment: 2 @@ -768,7 +768,7 @@ MonoBehaviour: m_Text: Calls m_Image: {fileID: 0} m_Tooltip: Total number of calls in a selected frame - m_TextWithWhitespace: + m_TextWithWhitespace: "Calls\u200B" contextMenuText: headerTextAlignment: 0 sortingArrowAlignment: 2 @@ -784,7 +784,7 @@ MonoBehaviour: m_Text: GC Alloc m_Image: {fileID: 0} m_Tooltip: - m_TextWithWhitespace: + m_TextWithWhitespace: "GC Alloc\u200B" contextMenuText: headerTextAlignment: 0 sortingArrowAlignment: 2 @@ -800,7 +800,7 @@ MonoBehaviour: m_Text: Time ms m_Image: {fileID: 0} m_Tooltip: Total time the selected function spends within a parent - m_TextWithWhitespace: + m_TextWithWhitespace: "Time ms\u200B" contextMenuText: headerTextAlignment: 0 sortingArrowAlignment: 2 @@ -817,7 +817,7 @@ MonoBehaviour: m_Image: {fileID: 0} m_Tooltip: Shows how often the selected function was called from the parent call - m_TextWithWhitespace: + m_TextWithWhitespace: "Time %\u200B" contextMenuText: headerTextAlignment: 0 sortingArrowAlignment: 2 @@ -991,7 +991,7 @@ MonoBehaviour: (Press ''F'' for frame selection)' - m_TextWithWhitespace: + m_TextWithWhitespace: "Called From\u200B" contextMenuText: headerTextAlignment: 0 sortingArrowAlignment: 2 @@ -1007,7 +1007,7 @@ MonoBehaviour: m_Text: Calls m_Image: {fileID: 0} m_Tooltip: Total number of calls in a selected frame - m_TextWithWhitespace: + m_TextWithWhitespace: "Calls\u200B" contextMenuText: headerTextAlignment: 0 sortingArrowAlignment: 2 @@ -1023,7 +1023,7 @@ MonoBehaviour: m_Text: GC Alloc m_Image: {fileID: 0} m_Tooltip: - m_TextWithWhitespace: + m_TextWithWhitespace: "GC Alloc\u200B" contextMenuText: headerTextAlignment: 0 sortingArrowAlignment: 2 @@ -1039,7 +1039,7 @@ MonoBehaviour: m_Text: Time ms m_Image: {fileID: 0} m_Tooltip: Total time the selected function spends within a parent - m_TextWithWhitespace: + m_TextWithWhitespace: "Time ms\u200B" contextMenuText: headerTextAlignment: 0 sortingArrowAlignment: 2 @@ -1056,7 +1056,7 @@ MonoBehaviour: m_Image: {fileID: 0} m_Tooltip: Shows how often the selected function was called from the parent call - m_TextWithWhitespace: + m_TextWithWhitespace: "Time %\u200B" contextMenuText: headerTextAlignment: 0 sortingArrowAlignment: 2 @@ -1104,7 +1104,7 @@ MonoBehaviour: (Press ''F'' for frame selection)' - m_TextWithWhitespace: + m_TextWithWhitespace: "Called From\u200B" contextMenuText: headerTextAlignment: 0 sortingArrowAlignment: 2 @@ -1120,7 +1120,7 @@ MonoBehaviour: m_Text: Calls m_Image: {fileID: 0} m_Tooltip: Total number of calls in a selected frame - m_TextWithWhitespace: + m_TextWithWhitespace: "Calls\u200B" contextMenuText: headerTextAlignment: 0 sortingArrowAlignment: 2 @@ -1136,7 +1136,7 @@ MonoBehaviour: m_Text: GC Alloc m_Image: {fileID: 0} m_Tooltip: - m_TextWithWhitespace: + m_TextWithWhitespace: "GC Alloc\u200B" contextMenuText: headerTextAlignment: 0 sortingArrowAlignment: 2 @@ -1152,7 +1152,7 @@ MonoBehaviour: m_Text: Time ms m_Image: {fileID: 0} m_Tooltip: Total time the selected function spends within a parent - m_TextWithWhitespace: + m_TextWithWhitespace: "Time ms\u200B" contextMenuText: headerTextAlignment: 0 sortingArrowAlignment: 2 @@ -1169,7 +1169,7 @@ MonoBehaviour: m_Image: {fileID: 0} m_Tooltip: Shows how often the selected function was called from the parent call - m_TextWithWhitespace: + m_TextWithWhitespace: "Time %\u200B" contextMenuText: headerTextAlignment: 0 sortingArrowAlignment: 2 @@ -1331,7 +1331,7 @@ MonoBehaviour: m_OverlaysVisible: 1 m_LockTracker: m_IsLocked: 0 - m_LastSelectedObjectID: 0 + m_LastSelectedObjectID: -35046 --- !u!114 &18 MonoBehaviour: m_ObjectHideFlags: 52 @@ -1355,7 +1355,7 @@ MonoBehaviour: serializedVersion: 2 x: 1 y: 559 - width: 450 + width: 222 height: 372 m_SerializedDataModeController: m_DataMode: 0 @@ -1391,8 +1391,8 @@ MonoBehaviour: serializedVersion: 2 x: 1 y: 24 - width: 681 - height: 505 + width: 270 + height: 337 m_SerializedDataModeController: m_DataMode: 0 m_PreferredDataMode: 0 @@ -1409,7 +1409,7 @@ MonoBehaviour: scrollPos: {x: 0, y: 0} m_SelectedIDs: m_LastClickedID: 0 - m_ExpandedIDs: 14fbffff + m_ExpandedIDs: 6e81ffff3082ffff9a92ffffee96ffff5ce3ffff12f2ffff04f3ffff14fbffff3eb9000050b90000 m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -1426,7 +1426,7 @@ MonoBehaviour: m_OriginalEventType: 11 m_IsRenamingFilename: 0 m_TrimLeadingAndTrailingWhitespace: 0 - m_ClientGUIView: {fileID: 0} + m_ClientGUIView: {fileID: 11} m_SearchString: m_ExpandedScenes: [] m_CurrenRootInstanceID: 0 @@ -1473,7 +1473,7 @@ MonoBehaviour: m_ObjectsLockedBeforeSerialization: [] m_InstanceIDsLockedBeforeSerialization: m_PreviewResizer: - m_CachedPref: -160 + m_CachedPref: 152 m_ControlHash: -371814159 m_PrefName: Preview_InspectorPreview m_LastInspectedObjectInstanceID: -1 @@ -1505,9 +1505,9 @@ MonoBehaviour: m_Pos: serializedVersion: 2 x: 1 - y: 555 - width: 681 - height: 376 + y: 387 + width: 270 + height: 544 m_SerializedDataModeController: m_DataMode: 0 m_PreferredDataMode: 0 @@ -1529,8 +1529,7 @@ MonoBehaviour: m_ShowAllHits: 0 m_SkipHidden: 0 m_SearchArea: 1 - m_Folders: - - Assets/Patterns_And_Principles/Patterns/The Observer Pattern/Scripts/WithoutEvent + m_Folders: [] m_Globs: [] m_ProductIds: m_AnyWithAssetOrigin: 0 @@ -1550,7 +1549,7 @@ MonoBehaviour: scrollPos: {x: 0, y: 0} m_SelectedIDs: 6edd0000 m_LastClickedID: 56686 - m_ExpandedIDs: 0000000052b9000054b9000056b9000058b900005ab90000 + m_ExpandedIDs: 00000000ceb90000d0b90000d2b90000d4b90000d6b90000d8b90000dab90000dcb90000deb90000e0b90000e2b90000e4b90000e6b90000e8b90000eab90000ecb90000eeb90000f0b90000f2b90000f4b90000f6b90000 m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -1576,10 +1575,10 @@ MonoBehaviour: m_Icon: {fileID: 0} m_ResourceFile: m_AssetTreeState: - scrollPos: {x: 0, y: 0} + scrollPos: {x: 0, y: 60} m_SelectedIDs: m_LastClickedID: 0 - m_ExpandedIDs: 0000000052b9000054b9000056b9000058b900005ab90000 + m_ExpandedIDs: 00000000ceb90000d0b90000d2b90000d4b90000d6b90000d8b90000dab90000dcb90000deb90000e0b90000e2b90000e4b90000e6b90000e8b90000eab90000ecb90000eeb90000f0b90000f2b90000f4b90000f6b90000 m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -1638,107 +1637,6 @@ MonoBehaviour: m_SkipHiddenPackages: 0 m_DirectoriesAreaWidth: 115 --- !u!114 &22 -MonoBehaviour: - m_ObjectHideFlags: 52 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 1 - m_Script: {fileID: 12015, guid: 0000000000000000e000000000000000, type: 0} - m_Name: - m_EditorClassIdentifier: - m_MinSize: {x: 200, y: 200} - m_MaxSize: {x: 4000, y: 4000} - m_TitleContent: - m_Text: Game - m_Image: {fileID: -6423792434712278376, guid: 0000000000000000d000000000000000, type: 0} - m_Tooltip: - m_TextWithWhitespace: "Game\u200B" - m_Pos: - serializedVersion: 2 - x: 0 - y: 24 - width: 403 - height: 907 - m_SerializedDataModeController: - m_DataMode: 0 - m_PreferredDataMode: 0 - m_SupportedDataModes: - isAutomatic: 1 - m_ViewDataDictionary: {fileID: 0} - m_OverlayCanvas: - m_LastAppliedPresetName: Default - m_SaveData: [] - m_ContainerData: [] - m_OverlaysVisible: 1 - m_SerializedViewNames: [] - m_SerializedViewValues: [] - m_PlayModeViewName: GameView - m_ShowGizmos: 0 - m_TargetDisplay: 0 - m_ClearColor: {r: 0, g: 0, b: 0, a: 0} - m_TargetSize: {x: 403, y: 886} - m_TextureFilterMode: 0 - m_TextureHideFlags: 61 - m_RenderIMGUI: 1 - m_EnterPlayModeBehavior: 0 - m_UseMipMap: 0 - m_VSyncEnabled: 0 - m_Gizmos: 0 - m_Stats: 0 - m_SelectedSizes: 00000000000000000000000000000000000000000000000000000000000000000000000000000000 - m_ZoomArea: - m_HRangeLocked: 0 - m_VRangeLocked: 0 - hZoomLockedByDefault: 0 - vZoomLockedByDefault: 0 - m_HBaseRangeMin: -201.5 - m_HBaseRangeMax: 201.5 - m_VBaseRangeMin: -443 - m_VBaseRangeMax: 443 - m_HAllowExceedBaseRangeMin: 1 - m_HAllowExceedBaseRangeMax: 1 - m_VAllowExceedBaseRangeMin: 1 - m_VAllowExceedBaseRangeMax: 1 - m_ScaleWithWindow: 0 - m_HSlider: 0 - m_VSlider: 0 - m_IgnoreScrollWheelUntilClicked: 0 - m_EnableMouseInput: 1 - m_EnableSliderZoomHorizontal: 0 - m_EnableSliderZoomVertical: 0 - m_UniformScale: 1 - m_UpDirection: 1 - m_DrawArea: - serializedVersion: 2 - x: 0 - y: 21 - width: 403 - height: 886 - m_Scale: {x: 1, y: 1} - m_Translation: {x: 201.5, y: 443} - m_MarginLeft: 0 - m_MarginRight: 0 - m_MarginTop: 0 - m_MarginBottom: 0 - m_LastShownAreaInsideMargins: - serializedVersion: 2 - x: -201.5 - y: -443 - width: 403 - height: 886 - m_MinimalGUI: 1 - m_defaultScale: 1 - m_LastWindowPixelSize: {x: 403, y: 907} - m_ClearInEditMode: 1 - m_NoCameraWarning: 1 - m_LowResolutionForAspectRatios: 00000000000000000000 - m_XRRenderMode: 0 - m_RenderTexture: {fileID: 0} - m_showToolbar: 1 ---- !u!114 &23 MonoBehaviour: m_ObjectHideFlags: 52 m_CorrespondingSourceObject: {fileID: 0} @@ -1761,7 +1659,7 @@ MonoBehaviour: serializedVersion: 2 x: 1 y: 24 - width: 450 + width: 222 height: 509 m_SerializedDataModeController: m_DataMode: 0 @@ -1861,12 +1759,12 @@ MonoBehaviour: displayed: 1 id: Orientation index: 0 - contents: '{"m_Layout":4,"m_Collapsed":false,"m_Floating":false,"m_FloatingSnapOffset":{"x":67.5,"y":-196.66665649414063},"m_SnapOffsetDelta":{"x":0.0,"y":0.0},"m_FloatingSnapCorner":2,"m_Size":{"x":0.0,"y":0.0},"m_SizeOverridden":false}' + contents: '{"m_Layout":4,"m_Collapsed":false,"m_Floating":false,"m_FloatingSnapOffset":{"x":-123.0,"y":-196.66665649414063},"m_SnapOffsetDelta":{"x":0.0,"y":0.0},"m_FloatingSnapCorner":3,"m_Size":{"x":0.0,"y":0.0},"m_SizeOverridden":false}' floating: 0 collapsed: 0 - snapOffset: {x: 67.5, y: -196.66666} + snapOffset: {x: -123, y: -196.66666} snapOffsetDelta: {x: 0, y: 0} - snapCorner: 2 + snapCorner: 3 layout: 4 size: {x: 0, y: 0} sizeOverridden: 0 @@ -2085,10 +1983,10 @@ MonoBehaviour: displayed: 1 id: AINavigationOverlay index: 12 - contents: '{"m_Layout":4,"m_Collapsed":false,"m_Floating":false,"m_FloatingSnapOffset":{"x":48.0,"y":48.0},"m_SnapOffsetDelta":{"x":0.0,"y":0.0},"m_FloatingSnapCorner":0,"m_Size":{"x":0.0,"y":0.0},"m_SizeOverridden":false}' + contents: '{"m_Layout":4,"m_Collapsed":false,"m_Floating":false,"m_FloatingSnapOffset":{"x":24.0,"y":48.0},"m_SnapOffsetDelta":{"x":0.0,"y":0.0},"m_FloatingSnapCorner":0,"m_Size":{"x":0.0,"y":0.0},"m_SizeOverridden":false}' floating: 0 collapsed: 0 - snapOffset: {x: 48, y: 48} + snapOffset: {x: 24, y: 48} snapOffsetDelta: {x: 0, y: 0} snapCorner: 0 layout: 4 @@ -2303,9 +2201,9 @@ MonoBehaviour: m_AudioPlay: 0 m_DebugDrawModesUseInteractiveLightBakingData: 0 m_Position: - m_Target: {x: 0, y: 0, z: 0} + m_Target: {x: 0, y: 1, z: -10} speed: 2 - m_Value: {x: 0, y: 0, z: 0} + m_Value: {x: 0, y: 1, z: -10} m_RenderMode: 0 m_CameraMode: drawMode: 0 @@ -2355,9 +2253,9 @@ MonoBehaviour: speed: 2 m_Value: {x: -0.08717229, y: 0.89959055, z: -0.21045254, w: -0.3726226} m_Size: - m_Target: 10 + m_Target: 12.124355 speed: 2 - m_Value: 10 + m_Value: 12.124355 m_Ortho: m_Target: 0 speed: 2 @@ -2378,7 +2276,7 @@ MonoBehaviour: m_LastSceneViewRotation: {x: 0, y: 0, z: 0, w: 0} m_LastSceneViewOrtho: 0 m_Viewpoint: - m_SceneView: {fileID: 23} + m_SceneView: {fileID: 22} m_CameraOverscanSettings: m_Opacity: 50 m_Scale: 1 @@ -2391,3 +2289,106 @@ MonoBehaviour: name: Contributors / Receivers section: Lighting m_ViewIsLockedToObject: 0 +--- !u!114 &23 +MonoBehaviour: + m_ObjectHideFlags: 52 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 1 + m_Script: {fileID: 12015, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_MinSize: {x: 200, y: 200} + m_MaxSize: {x: 4000, y: 4000} + m_TitleContent: + m_Text: Game + m_Image: {fileID: -6423792434712278376, guid: 0000000000000000d000000000000000, type: 0} + m_Tooltip: + m_TextWithWhitespace: "Game\u200B" + m_Pos: + serializedVersion: 2 + x: 0 + y: 24 + width: 1042 + height: 907 + m_SerializedDataModeController: + m_DataMode: 0 + m_PreferredDataMode: 0 + m_SupportedDataModes: + isAutomatic: 1 + m_ViewDataDictionary: {fileID: 0} + m_OverlayCanvas: + m_LastAppliedPresetName: Default + m_SaveData: [] + m_ContainerData: [] + m_OverlaysVisible: 1 + m_SerializedViewNames: + - UnityEditor.DeviceSimulation.SimulatorWindow + m_SerializedViewValues: + - F:\_Work\_PersonelWorks\Courses\Programming Design Patterns And Principles\Library\PlayModeViewStates\212fa1687647ce346b14859c39b974cb + m_PlayModeViewName: GameView + m_ShowGizmos: 0 + m_TargetDisplay: 0 + m_ClearColor: {r: 0, g: 0, b: 0, a: 0} + m_TargetSize: {x: 1920, y: 1080} + m_TextureFilterMode: 0 + m_TextureHideFlags: 61 + m_RenderIMGUI: 1 + m_EnterPlayModeBehavior: 0 + m_UseMipMap: 0 + m_VSyncEnabled: 0 + m_Gizmos: 0 + m_Stats: 0 + m_SelectedSizes: 03000000000000000000000000000000000000000000000000000000000000000000000000000000 + m_ZoomArea: + m_HRangeLocked: 0 + m_VRangeLocked: 0 + hZoomLockedByDefault: 0 + vZoomLockedByDefault: 0 + m_HBaseRangeMin: -960 + m_HBaseRangeMax: 960 + m_VBaseRangeMin: -540 + m_VBaseRangeMax: 540 + m_HAllowExceedBaseRangeMin: 1 + m_HAllowExceedBaseRangeMax: 1 + m_VAllowExceedBaseRangeMin: 1 + m_VAllowExceedBaseRangeMax: 1 + m_ScaleWithWindow: 0 + m_HSlider: 0 + m_VSlider: 0 + m_IgnoreScrollWheelUntilClicked: 0 + m_EnableMouseInput: 1 + m_EnableSliderZoomHorizontal: 0 + m_EnableSliderZoomVertical: 0 + m_UniformScale: 1 + m_UpDirection: 1 + m_DrawArea: + serializedVersion: 2 + x: 0 + y: 21 + width: 1042 + height: 886 + m_Scale: {x: 0.54270834, y: 0.54270834} + m_Translation: {x: 521, y: 443} + m_MarginLeft: 0 + m_MarginRight: 0 + m_MarginTop: 0 + m_MarginBottom: 0 + m_LastShownAreaInsideMargins: + serializedVersion: 2 + x: -960 + y: -816.27637 + width: 1920 + height: 1632.5527 + m_MinimalGUI: 1 + m_defaultScale: 0.54270834 + m_LastWindowPixelSize: {x: 1042, y: 907} + m_ClearInEditMode: 1 + m_NoCameraWarning: 1 + m_LowResolutionForAspectRatios: 01000000000000000000 + m_XRRenderMode: 0 + m_RenderTexture: {fileID: 0} + m_showToolbar: 1