From b96029fd5e3157afc58d18e2c6eeaeb732431993 Mon Sep 17 00:00:00 2001 From: Roman <1325980292@qq.com> Date: Sun, 13 Mar 2022 21:40:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=EF=BC=9A=E7=BC=96=E5=86=99?= =?UTF-8?q?=E5=BA=8F=E7=AB=A0=E5=9C=BA=E6=99=AF=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1.编写交互操作逻辑,我会用脚本给玩家物体添加一个子物体,子物体有一个触发器,当玩家按下交互键,通过回调看是否有Catch到的可交互物体,若有,我会触发可交互物体的OnCall,若没有,则不做反应。 2.编写可交互物体基类,可交互物体继承自Event,Start时检查碰撞盒状态。当检查到玩家进入触发器,把自己交给玩家的Catch。当检查到玩家离开触发器,看目前的Catch是否和自己一样,若一样则清除Catch,若不一样说明已经Catch了其他东西,不做反应。 3.编写绳结类,继承自可交互物体。当交互,给中介者发送信息,让中介者更改记录的当前记录的绳结是哪一个 (1.内含一个来自中介者的枚举类型的变量,记录自己属于哪一种绳结 (2.当OnCall,把自己的类型发给中介者 4.编写绳结中介者,负责玩家、皇帝和绳结的信息交流。 (1.有一个枚举类型,内含三种绳结种类 (2.有一个枚举类型的变量,记录当前记录的是哪一个绳结 (3.当绳结发来信息,更新记录的当前绳结 5.添加新的按键监听,并增加PlayerControl的虚函数 6.编写黄帝类 (1.继承自可交互物体 (2.内含一个来自中介者的枚举类型,记录皇帝对哪一种绳结提出要求 (3.当OnCall,检查中介者中记录的绳结和要求的是不是同一种,若是则触发后续流程,若不是,则触发摇头等动作,目前不做反应 (4.内含函数与后期外界对接,用来指定皇帝需要的绳结类型 *记得给Player类的Interact函数加上Base 我是每天上班提醒小助手,今天你上班了吗?😺 --- Assets/InputAssets/PlayerC.cs | 82 ++ Assets/InputAssets/PlayerC.inputactions | 62 + .../Demos/Editor Windows.unitypackage.meta | 7 + .../Sample - RPG Editor.unitypackage.meta | 7 + Assets/Scenes/勍/InteractTest.unity | 1075 +++++++++++++++++ Assets/Scenes/勍/InteractTest.unity.meta | 7 + Assets/Scripts/勍/HuangDi.cs | 30 + Assets/Scripts/勍/HuangDi.cs.meta | 11 + Assets/Scripts/勍/Interactable.cs | 38 + Assets/Scripts/勍/Interactable.cs.meta | 11 + Assets/Scripts/勍/KnotMediator.cs | 39 + Assets/Scripts/勍/KnotMediator.cs.meta | 11 + Assets/Scripts/勍/Kont.cs | 28 + Assets/Scripts/勍/Kont.cs.meta | 11 + Assets/Scripts/勍/PlayerControl.cs | 28 +- Assets/Scripts/勍/PlayerInteract.cs | 31 + Assets/Scripts/勍/PlayerInteract.cs.meta | 11 + Logs/ApiUpdaterCheck.txt | 10 + UserSettings/EditorUserSettings.asset | 5 +- 19 files changed, 1502 insertions(+), 2 deletions(-) create mode 100644 Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage.meta create mode 100644 Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage.meta create mode 100644 Assets/Scenes/勍/InteractTest.unity create mode 100644 Assets/Scenes/勍/InteractTest.unity.meta create mode 100644 Assets/Scripts/勍/HuangDi.cs create mode 100644 Assets/Scripts/勍/HuangDi.cs.meta create mode 100644 Assets/Scripts/勍/Interactable.cs create mode 100644 Assets/Scripts/勍/Interactable.cs.meta create mode 100644 Assets/Scripts/勍/KnotMediator.cs create mode 100644 Assets/Scripts/勍/KnotMediator.cs.meta create mode 100644 Assets/Scripts/勍/Kont.cs create mode 100644 Assets/Scripts/勍/Kont.cs.meta create mode 100644 Assets/Scripts/勍/PlayerInteract.cs create mode 100644 Assets/Scripts/勍/PlayerInteract.cs.meta diff --git a/Assets/InputAssets/PlayerC.cs b/Assets/InputAssets/PlayerC.cs index a0f12d7..156a418 100644 --- a/Assets/InputAssets/PlayerC.cs +++ b/Assets/InputAssets/PlayerC.cs @@ -62,6 +62,24 @@ public partial class @PlayerC : IInputActionCollection2, IDisposable ""processors"": """", ""interactions"": """", ""initialStateCheck"": false + }, + { + ""name"": ""LeftChange"", + ""type"": ""Button"", + ""id"": ""5e4b2241-fdf3-4717-9892-456eb07bff7d"", + ""expectedControlType"": ""Button"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false + }, + { + ""name"": ""RightChange"", + ""type"": ""Button"", + ""id"": ""25825820-ed63-4821-a570-98c0346d0114"", + ""expectedControlType"": ""Button"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false } ], ""bindings"": [ @@ -196,6 +214,50 @@ public partial class @PlayerC : IInputActionCollection2, IDisposable ""action"": ""Interact"", ""isComposite"": false, ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""848dbb1f-2a82-4dc8-9673-c7f69bc2eaa5"", + ""path"": ""/q"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""LeftChange"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""d1bc2781-7f70-4170-93c3-c849ff56c3cf"", + ""path"": ""/dpad/left"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""LeftChange"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""bdd4c52b-c221-49d3-b467-201ebc18cb71"", + ""path"": ""/e"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""RightChange"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""257c9bb8-7e77-4e5c-9caf-97284fb0adbd"", + ""path"": ""/dpad/right"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""RightChange"", + ""isComposite"": false, + ""isPartOfComposite"": false } ] }, @@ -253,6 +315,8 @@ public partial class @PlayerC : IInputActionCollection2, IDisposable m_Normal_Atk = m_Normal.FindAction("Atk", throwIfNotFound: true); m_Normal_Jump = m_Normal.FindAction("Jump", throwIfNotFound: true); m_Normal_Interact = m_Normal.FindAction("Interact", throwIfNotFound: true); + m_Normal_LeftChange = m_Normal.FindAction("LeftChange", throwIfNotFound: true); + m_Normal_RightChange = m_Normal.FindAction("RightChange", throwIfNotFound: true); // Null m_Null = asset.FindActionMap("Null", throwIfNotFound: true); m_Null_Newaction = m_Null.FindAction("New action", throwIfNotFound: true); @@ -319,6 +383,8 @@ public partial class @PlayerC : IInputActionCollection2, IDisposable private readonly InputAction m_Normal_Atk; private readonly InputAction m_Normal_Jump; private readonly InputAction m_Normal_Interact; + private readonly InputAction m_Normal_LeftChange; + private readonly InputAction m_Normal_RightChange; public struct NormalActions { private @PlayerC m_Wrapper; @@ -327,6 +393,8 @@ public partial class @PlayerC : IInputActionCollection2, IDisposable public InputAction @Atk => m_Wrapper.m_Normal_Atk; public InputAction @Jump => m_Wrapper.m_Normal_Jump; public InputAction @Interact => m_Wrapper.m_Normal_Interact; + public InputAction @LeftChange => m_Wrapper.m_Normal_LeftChange; + public InputAction @RightChange => m_Wrapper.m_Normal_RightChange; public InputActionMap Get() { return m_Wrapper.m_Normal; } public void Enable() { Get().Enable(); } public void Disable() { Get().Disable(); } @@ -348,6 +416,12 @@ public partial class @PlayerC : IInputActionCollection2, IDisposable @Interact.started -= m_Wrapper.m_NormalActionsCallbackInterface.OnInteract; @Interact.performed -= m_Wrapper.m_NormalActionsCallbackInterface.OnInteract; @Interact.canceled -= m_Wrapper.m_NormalActionsCallbackInterface.OnInteract; + @LeftChange.started -= m_Wrapper.m_NormalActionsCallbackInterface.OnLeftChange; + @LeftChange.performed -= m_Wrapper.m_NormalActionsCallbackInterface.OnLeftChange; + @LeftChange.canceled -= m_Wrapper.m_NormalActionsCallbackInterface.OnLeftChange; + @RightChange.started -= m_Wrapper.m_NormalActionsCallbackInterface.OnRightChange; + @RightChange.performed -= m_Wrapper.m_NormalActionsCallbackInterface.OnRightChange; + @RightChange.canceled -= m_Wrapper.m_NormalActionsCallbackInterface.OnRightChange; } m_Wrapper.m_NormalActionsCallbackInterface = instance; if (instance != null) @@ -364,6 +438,12 @@ public partial class @PlayerC : IInputActionCollection2, IDisposable @Interact.started += instance.OnInteract; @Interact.performed += instance.OnInteract; @Interact.canceled += instance.OnInteract; + @LeftChange.started += instance.OnLeftChange; + @LeftChange.performed += instance.OnLeftChange; + @LeftChange.canceled += instance.OnLeftChange; + @RightChange.started += instance.OnRightChange; + @RightChange.performed += instance.OnRightChange; + @RightChange.canceled += instance.OnRightChange; } } } @@ -416,6 +496,8 @@ public partial class @PlayerC : IInputActionCollection2, IDisposable void OnAtk(InputAction.CallbackContext context); void OnJump(InputAction.CallbackContext context); void OnInteract(InputAction.CallbackContext context); + void OnLeftChange(InputAction.CallbackContext context); + void OnRightChange(InputAction.CallbackContext context); } public interface INullActions { diff --git a/Assets/InputAssets/PlayerC.inputactions b/Assets/InputAssets/PlayerC.inputactions index a46786e..49f3603 100644 --- a/Assets/InputAssets/PlayerC.inputactions +++ b/Assets/InputAssets/PlayerC.inputactions @@ -40,6 +40,24 @@ "processors": "", "interactions": "", "initialStateCheck": false + }, + { + "name": "LeftChange", + "type": "Button", + "id": "5e4b2241-fdf3-4717-9892-456eb07bff7d", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "RightChange", + "type": "Button", + "id": "25825820-ed63-4821-a570-98c0346d0114", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false } ], "bindings": [ @@ -174,6 +192,50 @@ "action": "Interact", "isComposite": false, "isPartOfComposite": false + }, + { + "name": "", + "id": "848dbb1f-2a82-4dc8-9673-c7f69bc2eaa5", + "path": "/q", + "interactions": "", + "processors": "", + "groups": "", + "action": "LeftChange", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "d1bc2781-7f70-4170-93c3-c849ff56c3cf", + "path": "/dpad/left", + "interactions": "", + "processors": "", + "groups": "", + "action": "LeftChange", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "bdd4c52b-c221-49d3-b467-201ebc18cb71", + "path": "/e", + "interactions": "", + "processors": "", + "groups": "", + "action": "RightChange", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "257c9bb8-7e77-4e5c-9caf-97284fb0adbd", + "path": "/dpad/right", + "interactions": "", + "processors": "", + "groups": "", + "action": "RightChange", + "isComposite": false, + "isPartOfComposite": false } ] }, diff --git a/Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage.meta b/Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage.meta new file mode 100644 index 0000000..130722a --- /dev/null +++ b/Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ed09910c0094cb27be8f3ca264680da3 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage.meta b/Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage.meta new file mode 100644 index 0000000..f9b8ed8 --- /dev/null +++ b/Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: cc355dd4cf1e6173beaeb22c2858cbe1 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/勍/InteractTest.unity b/Assets/Scenes/勍/InteractTest.unity new file mode 100644 index 0000000..624ef8d --- /dev/null +++ b/Assets/Scenes/勍/InteractTest.unity @@ -0,0 +1,1075 @@ +%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: 9 + 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: 3 + 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_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + 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_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + 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: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + 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 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &56909002 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 56909005} + - component: {fileID: 56909004} + - component: {fileID: 56909003} + - component: {fileID: 56909006} + m_Layer: 0 + m_Name: "\u7EF3\u7ED3" + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &56909003 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 56909002} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: aaac64616770dce42a623c267c4d9d31, type: 3} + m_Name: + m_EditorClassIdentifier: + type: 1 +--- !u!61 &56909004 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 56909002} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 1, y: 1} + newSize: {x: 1, y: 1} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 1, y: 1} + m_EdgeRadius: 0 +--- !u!4 &56909005 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 56909002} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -6.62, y: -3.54, z: -0.38423085} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &56909006 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 56909002} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 3cb7c35a750699348a04840d1ae1be5e, type: 3} + m_Color: {r: 1, g: 0, b: 0, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &110133614 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 110133615} + - component: {fileID: 110133616} + - component: {fileID: 110133618} + - component: {fileID: 110133617} + - component: {fileID: 110133619} + m_Layer: 0 + m_Name: Player + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &110133615 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 110133614} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.23, y: -3.44, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &110133616 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 110133614} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 94a70686225bbcc40a44a76ac05951e0, type: 3} + m_Name: + m_EditorClassIdentifier: + inputDir: 0 + GroundCheck: {fileID: 0} + isRight: 1 + isGround: 0 + speed: 10 + jumpForce: 5 + flipDuration: 0.1 +--- !u!61 &110133617 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 110133614} + 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_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 1, y: 1} + newSize: {x: 0.16, y: 0.16} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 1, y: 1} + m_EdgeRadius: 0 +--- !u!50 &110133618 +Rigidbody2D: + serializedVersion: 4 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 110133614} + m_BodyType: 0 + m_Simulated: 1 + m_UseFullKinematicContacts: 0 + m_UseAutoMass: 0 + m_Mass: 1 + m_LinearDrag: 0 + m_AngularDrag: 0.05 + m_GravityScale: 1 + m_Material: {fileID: 0} + m_Interpolate: 0 + m_SleepingMode: 1 + m_CollisionDetection: 0 + m_Constraints: 0 +--- !u!212 &110133619 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 110133614} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 3cb7c35a750699348a04840d1ae1be5e, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 0.16, y: 0.16} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &226789349 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 226789352} + - component: {fileID: 226789351} + - component: {fileID: 226789350} + 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 &226789350 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 226789349} + m_Enabled: 1 +--- !u!20 &226789351 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 226789349} + 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_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + 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: 1 + 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 &226789352 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 226789349} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + 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!1 &363924800 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 363924804} + - component: {fileID: 363924803} + - component: {fileID: 363924802} + - component: {fileID: 363924801} + m_Layer: 0 + m_Name: "\u7EF3\u7ED3 (2)" + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &363924801 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 363924800} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 3cb7c35a750699348a04840d1ae1be5e, type: 3} + m_Color: {r: 0, g: 0.30392504, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &363924802 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 363924800} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: aaac64616770dce42a623c267c4d9d31, type: 3} + m_Name: + m_EditorClassIdentifier: + type: 3 +--- !u!61 &363924803 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 363924800} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 1, y: 1} + newSize: {x: 1, y: 1} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 1, y: 1} + m_EdgeRadius: 0 +--- !u!4 &363924804 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 363924800} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -2.32, y: -3.54, z: -0.38423085} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1103262709 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1103262711} + - component: {fileID: 1103262710} + m_Layer: 0 + m_Name: "\u7EF3\u7ED3\u4E2D\u4ECB\u8005" + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1103262710 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1103262709} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ad9fbcfc0d0c69744804efe3d7ad3fce, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &1103262711 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1103262709} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -6.2134485, y: -3.532711, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1180244203 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1180244205} + - component: {fileID: 1180244204} + m_Layer: 0 + m_Name: Freeform Light 2D + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1180244204 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1180244203} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 073797afb82c5a1438f328866b10b3f0, type: 3} + m_Name: + m_EditorClassIdentifier: + m_LightType: 1 + m_BlendStyleIndex: 0 + m_FalloffIntensity: 0.5 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 1 + m_LightVolumeOpacity: 0 + m_ApplyToSortingLayers: 00000000 + m_LightCookieSprite: {fileID: 0} + m_UseNormalMap: 0 + m_LightOrder: 0 + m_AlphaBlendOnOverlap: 0 + m_ShadowIntensity: 0 + m_ShadowVolumeIntensity: 0 + m_PointLightInnerAngle: 360 + m_PointLightOuterAngle: 360 + m_PointLightInnerRadius: 0 + m_PointLightOuterRadius: 1 + m_PointLightDistance: 3 + m_PointLightQuality: 1 + m_ShapeLightParametricSides: 5 + m_ShapeLightParametricAngleOffset: 0 + m_ShapeLightParametricRadius: 1 + m_ShapeLightFalloffSize: 68.92 + m_ShapeLightFalloffOffset: {x: 0, y: 0} + m_ShapePath: + - {x: -0.5, y: -0.5, z: 0} + - {x: 0.5, y: -0.5, z: 0} + - {x: 0.5, y: 0.5, z: 0} + - {x: -0.5, y: 0.5, z: 0} +--- !u!4 &1180244205 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1180244203} + 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: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1238745903 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1238745904} + - component: {fileID: 1238745905} + - component: {fileID: 1238745906} + m_Layer: 0 + m_Name: Ground + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1238745904 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1238745903} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 2.1064527, y: -4.55, z: -0.38423085} + m_LocalScale: {x: 38.05, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!61 &1238745905 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1238745903} + 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_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 1, y: 1} + newSize: {x: 1, y: 1} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 1, y: 1} + m_EdgeRadius: 0 +--- !u!212 &1238745906 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1238745903} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 3cb7c35a750699348a04840d1ae1be5e, type: 3} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &1750262981 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1750262982} + - component: {fileID: 1750262984} + - component: {fileID: 1750262983} + - component: {fileID: 1750262985} + m_Layer: 0 + m_Name: "\u7687\u5E1D" + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1750262982 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1750262981} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 7.15, y: -3.53, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!61 &1750262983 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1750262981} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 1, y: 1} + newSize: {x: 1, y: 1} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 1, y: 1} + m_EdgeRadius: 0 +--- !u!114 &1750262984 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1750262981} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e1b2323b7275ad44c94037be9f2ccec3, type: 3} + m_Name: + m_EditorClassIdentifier: + neededType: 1 +--- !u!212 &1750262985 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1750262981} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 3cb7c35a750699348a04840d1ae1be5e, type: 3} + m_Color: {r: 0.8880594, g: 1, b: 0, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &1836672841 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1836672845} + - component: {fileID: 1836672844} + - component: {fileID: 1836672843} + - component: {fileID: 1836672842} + m_Layer: 0 + m_Name: "\u7EF3\u7ED3 (1)" + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &1836672842 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1836672841} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 3cb7c35a750699348a04840d1ae1be5e, type: 3} + m_Color: {r: 0, g: 1, b: 0.0858655, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &1836672843 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1836672841} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: aaac64616770dce42a623c267c4d9d31, type: 3} + m_Name: + m_EditorClassIdentifier: + type: 2 +--- !u!61 &1836672844 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1836672841} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 1, y: 1} + newSize: {x: 1, y: 1} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 1, y: 1} + m_EdgeRadius: 0 +--- !u!4 &1836672845 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1836672841} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -4.35, y: -3.54, z: -0.38423085} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/Scenes/勍/InteractTest.unity.meta b/Assets/Scenes/勍/InteractTest.unity.meta new file mode 100644 index 0000000..fb2ce41 --- /dev/null +++ b/Assets/Scenes/勍/InteractTest.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9d2abd5208f4caf4fb48d255afe4a1c8 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/勍/HuangDi.cs b/Assets/Scripts/勍/HuangDi.cs new file mode 100644 index 0000000..7013c3e --- /dev/null +++ b/Assets/Scripts/勍/HuangDi.cs @@ -0,0 +1,30 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using Sirenix.OdinInspector; + +/// +/// 皇帝类,控制皇帝的行为,继承自可交互物体 +/// +public class HuangDi : Interactable +{ + [SerializeField][EnumPaging] + private KnotMediator.KnotType neededType = KnotMediator.KnotType.None; + + public override void OnCall() + { + if(KnotMediator.Instance.CheckKnotType(neededType)) + { + Debug.Log("皇帝接受了绳结"); + } + else + { + Debug.Log("皇帝拒绝了绳结"); + } + } + + public void setNeededType(KnotMediator.KnotType type) + { + neededType = type; + } +} diff --git a/Assets/Scripts/勍/HuangDi.cs.meta b/Assets/Scripts/勍/HuangDi.cs.meta new file mode 100644 index 0000000..8afd6ce --- /dev/null +++ b/Assets/Scripts/勍/HuangDi.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e1b2323b7275ad44c94037be9f2ccec3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/勍/Interactable.cs b/Assets/Scripts/勍/Interactable.cs new file mode 100644 index 0000000..c317f85 --- /dev/null +++ b/Assets/Scripts/勍/Interactable.cs @@ -0,0 +1,38 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +/// +/// 可交互物件基类 +/// +public class Interactable : Event +{ + void Start() + { + //检查触发器 + if (GetComponent() == null) + { + Debug.LogError(this.GetType() + ": 没有碰撞盒"); + } + else if(GetComponent().isTrigger == false) + { + Debug.LogError(this.GetType() + ": 碰撞盒没有设置为触发器"); + } + } + + void OnTriggerEnter2D(Collider2D other) + { + if (other.TryGetComponent(out PlayerInteract playerInteract)) + { + playerInteract.SetCatched(this); + } + } + + void OnTriggerExit2D(Collider2D other) + { + if (other.TryGetComponent(out PlayerInteract playerInteract)) + { + playerInteract.CancleCatched(this); + } + } +} diff --git a/Assets/Scripts/勍/Interactable.cs.meta b/Assets/Scripts/勍/Interactable.cs.meta new file mode 100644 index 0000000..c30779a --- /dev/null +++ b/Assets/Scripts/勍/Interactable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1efac6c6faf3ed94db548016ffee8ce5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/勍/KnotMediator.cs b/Assets/Scripts/勍/KnotMediator.cs new file mode 100644 index 0000000..5eb81fd --- /dev/null +++ b/Assets/Scripts/勍/KnotMediator.cs @@ -0,0 +1,39 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using Sirenix.OdinInspector; + +/// +/// 绳结中介者,负责交流皇帝、玩家、绳结的信息 +/// +public class KnotMediator : UnitySingleton +{ + public enum KnotType + { + None, + 带毛刺的绳结, + 编成麻花的绳结, + 有鸡毛的绳结 + } + + /// + /// 当前记录的绳结类型 + /// + [Header("当前记录的绳结类型")][SerializeField][ReadOnly][EnumPaging] + private KnotType currentKnotType; + + public void RecordKnotType(KnotType knotType) + { + currentKnotType = knotType; + } + + /// + /// 有黄帝调用,检查当前记录的和需要的绳结类型是否一致 + /// + /// 黄帝需要的绳结类型 + /// + public bool CheckKnotType(KnotType knotType) + { + return knotType == currentKnotType; + } +} diff --git a/Assets/Scripts/勍/KnotMediator.cs.meta b/Assets/Scripts/勍/KnotMediator.cs.meta new file mode 100644 index 0000000..418fe0d --- /dev/null +++ b/Assets/Scripts/勍/KnotMediator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ad9fbcfc0d0c69744804efe3d7ad3fce +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/勍/Kont.cs b/Assets/Scripts/勍/Kont.cs new file mode 100644 index 0000000..abdc869 --- /dev/null +++ b/Assets/Scripts/勍/Kont.cs @@ -0,0 +1,28 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using Sirenix.OdinInspector; + +/// +/// 绳结类,继承自可交互物体 +/// +public class Kont : Interactable +{ + /// + /// 自身绳结类型 + /// + [EnumPaging][Header("自身绳结类型")] + public KnotMediator.KnotType type; + + public override void OnCall() + { + // 如果绳结类型为空,则报错 + if (type == KnotMediator.KnotType.None) + { + Debug.LogError("绳结类型为空,请设置绳结类型"); + return; + } + //切换记录的绳结类型 + KnotMediator.Instance.RecordKnotType(type); + } +} diff --git a/Assets/Scripts/勍/Kont.cs.meta b/Assets/Scripts/勍/Kont.cs.meta new file mode 100644 index 0000000..8145c30 --- /dev/null +++ b/Assets/Scripts/勍/Kont.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: aaac64616770dce42a623c267c4d9d31 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/勍/PlayerControl.cs b/Assets/Scripts/勍/PlayerControl.cs index 4e35134..ee502f6 100644 --- a/Assets/Scripts/勍/PlayerControl.cs +++ b/Assets/Scripts/勍/PlayerControl.cs @@ -16,6 +16,7 @@ public class PlayerControl : MonoBehaviour /// [SerializeField][ReadOnly][Header("此帧输入方向,-1为左,1为右,0表示此帧不输入")] protected int inputDir; + protected PlayerInteract playerInteract; protected virtual void Start() { @@ -32,6 +33,19 @@ public class PlayerControl : MonoBehaviour playerC.Normal.Jump.performed += ctx => OnJump(); //为交互操作订阅方法 playerC.Normal.Interact.performed += ctx => OnInteract(); + //为左切换操作订阅方法 + playerC.Normal.LeftChange.performed += ctx => OnLeftChange(); + //为右切换操作订阅方法 + playerC.Normal.RightChange.performed += ctx => OnRightChange(); + + + //给玩家物体添加子物体:互动侦察器 + GameObject checker = new GameObject("互动侦察器");//新建游戏物体:互动侦察器 + checker.transform.SetParent(transform);//将其设置为玩家的子物体 + playerInteract = checker.AddComponent();//增加玩家互动侦察器组件 + checker.AddComponent().isTrigger = true;//增加碰撞盒,并将其设置为触发器 + checker.GetComponent().size = new Vector2(1f, 1f);//设置碰撞盒大小 + checker.transform.localPosition = Vector3.zero;//设置碰撞盒位置 } /// @@ -62,5 +76,17 @@ public class PlayerControl : MonoBehaviour /// /// 按下交互时触发 /// - protected virtual void OnInteract(){} + protected virtual void OnInteract(){ + //如果有交互事件,则调用事件 + playerInteract.OnCall(); + } + + /// + /// 按下十字键左或者Q触发 + /// + protected virtual void OnLeftChange(){} + /// + /// 按下十字键右或者E触发 + /// + protected virtual void OnRightChange(){} } diff --git a/Assets/Scripts/勍/PlayerInteract.cs b/Assets/Scripts/勍/PlayerInteract.cs new file mode 100644 index 0000000..7b7e41e --- /dev/null +++ b/Assets/Scripts/勍/PlayerInteract.cs @@ -0,0 +1,31 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using Sirenix.OdinInspector; + +/// +/// 玩家交互组件,挂在玩家下面的子物体中 +/// +public class PlayerInteract : MonoBehaviour +{ + [SerializeField][ReadOnly] + private Event catched; + public void SetCatched(Event e) + { + catched = e; + } + public void CancleCatched(Event e) + { + if (e == catched) + { + catched = null; + } + } + public void OnCall() + { + if (catched != null) + { + catched.OnCall(); + } + } +} diff --git a/Assets/Scripts/勍/PlayerInteract.cs.meta b/Assets/Scripts/勍/PlayerInteract.cs.meta new file mode 100644 index 0000000..9c7f78b --- /dev/null +++ b/Assets/Scripts/勍/PlayerInteract.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 53a9e33ba521aa9469cf8214c44310e5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Logs/ApiUpdaterCheck.txt b/Logs/ApiUpdaterCheck.txt index ae7ca0c..f403dc6 100644 --- a/Logs/ApiUpdaterCheck.txt +++ b/Logs/ApiUpdaterCheck.txt @@ -38,3 +38,13 @@ C# parse time : -1ms candidates check time : -1ms console write time : -1ms +[api-updater (non-obsolete-error-filter)] 2022/3/13 21:33:35 : Starting D:/unity/Editor/2020.3.30f1c1/Editor/Data/Tools/ScriptUpdater/APIUpdater.NonObsoleteApiUpdaterDetector.exe +[api-updater (non-obsolete-error-filter)] +---------------------------------- +jit/startup time : 826.23ms +moved types parse time: 48ms +candidates parse time : 1ms +C# parse time : -1ms +candidates check time : -1ms +console write time : -1ms + diff --git a/UserSettings/EditorUserSettings.asset b/UserSettings/EditorUserSettings.asset index 6881a83..1ec0d9e 100644 --- a/UserSettings/EditorUserSettings.asset +++ b/UserSettings/EditorUserSettings.asset @@ -17,9 +17,12 @@ EditorUserSettings: RecentlyUsedScenePath-3: value: 22424703114646680e0b0227036c6c111b07142f1f2b233e2867083debf42d flags: 0 - RecentlyUsedScenePath-5: + RecentlyUsedScenePath-4: value: 22424703114646680e0b0227036cdbc9e6582b2b21382a357c67083debf42d flags: 0 + RecentlyUsedScenePath-5: + value: 22424703114646680e0b0227036cdafbfb583124382d34312e3d2936f1f47a2decee22f0 + flags: 0 vcSharedLogLevel: value: 0d5e400f0650 flags: 0