From 2f91268155ef4b3e7096dbdad109dcab908a21c3 Mon Sep 17 00:00:00 2001 From: haitem Date: Fri, 29 Jan 2021 23:56:23 +0100 Subject: [PATCH] Remake project to see from side --- Assets/Prefab/Player.prefab | 673 ++++++++++++++++++++----------- Assets/Scenes/SampleScene.unity | 269 ++++++++---- Assets/Scripts/ObjectManager.cs | 23 ++ Assets/Scripts/PlayerManager.cs | 48 +-- Assets/Textures/New Material.mat | 77 ++++ 5 files changed, 737 insertions(+), 353 deletions(-) create mode 100644 Assets/Scripts/ObjectManager.cs create mode 100644 Assets/Textures/New Material.mat diff --git a/Assets/Prefab/Player.prefab b/Assets/Prefab/Player.prefab index 96b5f93..dc14d19 100644 --- a/Assets/Prefab/Player.prefab +++ b/Assets/Prefab/Player.prefab @@ -1,6 +1,112 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!1 &780077361488814237 +--- !u!1 &7801516488764644390 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 8667386836911801605, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7801516488764644385} + - component: {fileID: 7801516488764644386} + - component: {fileID: 7801516488764644387} + - component: {fileID: 7801516488764644388} + - component: {fileID: 7801516488764644389} + m_Layer: 0 + m_Name: Player + m_TagString: Player + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7801516488764644385 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 8667386836911801602, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7801516488764644390} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 7801516489716195986} + - {fileID: 7801516489801019557} + - {fileID: 7801516489260475680} + - {fileID: 7801516489048978513} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!136 &7801516488764644386 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 8667386836911801601, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7801516488764644390} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 1, z: 0} +--- !u!54 &7801516488764644387 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 8667386836911801600, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7801516488764644390} + serializedVersion: 2 + m_Mass: 70 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 120 + m_CollisionDetection: 0 +--- !u!114 &7801516488764644388 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 8667386836911801603, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7801516488764644390} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b520c64fdc2dfed458e743095a22f69d, type: 3} + m_Name: + m_EditorClassIdentifier: + speed: 8 + runSpeed: 20 + rotateSpeed: 5 + mouseSensitive: 100 + jump: 5 + onGround: 0 +--- !u!136 &7801516488764644389 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 4768974422273388731, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7801516488764644390} + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_Enabled: 1 + m_Radius: 0.35 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0.9, z: 0} +--- !u!1 &7801516489048978514 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -8,9 +114,105 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 3574189786560089910} - - component: {fileID: 1899701896722209425} - - component: {fileID: 4336171388043989931} + - component: {fileID: 7801516489048978513} + - component: {fileID: 7801516489048978542} + - component: {fileID: 7801516489048978543} + - component: {fileID: 7801516489048978512} + m_Layer: 0 + m_Name: Capsule + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7801516489048978513 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7801516489048978514} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1.1, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 7801516490449566174} + m_Father: {fileID: 7801516488764644385} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &7801516489048978542 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7801516489048978514} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &7801516489048978543 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7801516489048978514} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!136 &7801516489048978512 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7801516489048978514} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &7801516489260475681 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 780077361488814237, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7801516489260475680} + - component: {fileID: 7801516489260475710} + - component: {fileID: 7801516489260475711} m_Layer: 0 m_Name: EventSystem m_TagString: Untagged @@ -18,27 +220,29 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &3574189786560089910 +--- !u!4 &7801516489260475680 Transform: m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 3574189786560089910, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 780077361488814237} + m_GameObject: {fileID: 7801516489260475681} 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: 8667386836911801602} + m_Father: {fileID: 7801516488764644385} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1899701896722209425 +--- !u!114 &7801516489260475710 MonoBehaviour: m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 1899701896722209425, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 780077361488814237} + m_GameObject: {fileID: 7801516489260475681} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} @@ -47,13 +251,14 @@ MonoBehaviour: m_FirstSelected: {fileID: 0} m_sendNavigationEvents: 1 m_DragThreshold: 10 ---- !u!114 &4336171388043989931 +--- !u!114 &7801516489260475711 MonoBehaviour: m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 4336171388043989931, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 780077361488814237} + m_GameObject: {fileID: 7801516489260475681} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} @@ -66,215 +271,19 @@ MonoBehaviour: m_InputActionsPerSecond: 10 m_RepeatDelay: 0.5 m_ForceModuleActive: 0 ---- !u!1 &5627282298304387526 +--- !u!1 &7801516489716195990 GameObject: m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 8667386838808186343, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 6104960137431343203} - - component: {fileID: 5327314824195544201} - - component: {fileID: 7753747927545331008} - - component: {fileID: 680770354065552892} - m_Layer: 0 - m_Name: Canvas - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &6104960137431343203 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5627282298304387526} - 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_Children: [] - m_Father: {fileID: 8667386836911801602} - m_RootOrder: 1 - 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!223 &5327314824195544201 -Canvas: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5627282298304387526} - m_Enabled: 1 - serializedVersion: 3 - m_RenderMode: 1 - m_Camera: {fileID: 8667386838808186341} - m_PlaneDistance: 0.4 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingBucketNormalizedSize: 0 - m_AdditionalShaderChannelsFlag: 0 - m_SortingLayerID: 0 - m_SortingOrder: 0 - m_TargetDisplay: 0 ---- !u!114 &7753747927545331008 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5627282298304387526} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} - m_Name: - m_EditorClassIdentifier: - m_UiScaleMode: 0 - m_ReferencePixelsPerUnit: 100 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 1 ---- !u!114 &680770354065552892 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5627282298304387526} - 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!1 &8667386836911801605 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 8667386836911801602} - - component: {fileID: 8667386836911801601} - - component: {fileID: 8667386836911801600} - - component: {fileID: 8667386836911801603} - - component: {fileID: 4768974422273388731} - m_Layer: 0 - m_Name: Player - m_TagString: Player - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &8667386836911801602 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8667386836911801605} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 8667386838808186338} - - {fileID: 6104960137431343203} - - {fileID: 3574189786560089910} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!136 &8667386836911801601 -CapsuleCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8667386836911801605} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - m_Radius: 0.5 - m_Height: 2 - m_Direction: 1 - m_Center: {x: 0, y: 1, z: 0} ---- !u!54 &8667386836911801600 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8667386836911801605} - serializedVersion: 2 - m_Mass: 70 - m_Drag: 0 - m_AngularDrag: 0.05 - m_UseGravity: 1 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 112 - m_CollisionDetection: 0 ---- !u!114 &8667386836911801603 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8667386836911801605} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: b520c64fdc2dfed458e743095a22f69d, type: 3} - m_Name: - m_EditorClassIdentifier: - speed: 8 - runSpeed: 20 - rotateSpeed: 5 - mouseSensitive: 100 - jump: 5 - onGround: 0 ---- !u!136 &4768974422273388731 -CapsuleCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8667386836911801605} - m_Material: {fileID: 0} - m_IsTrigger: 1 - m_Enabled: 1 - m_Radius: 0.35 - m_Height: 2 - m_Direction: 1 - m_Center: {x: 0, y: 0.9, z: 0} ---- !u!1 &8667386838808186343 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 8667386838808186338} - - component: {fileID: 8667386838808186341} - - component: {fileID: 8667386838808186340} - - component: {fileID: 8688770579720177661} + - component: {fileID: 7801516489716195986} + - component: {fileID: 7801516489716195989} + - component: {fileID: 7801516489716195987} + - component: {fileID: 7801516489716195988} m_Layer: 0 m_Name: Main Camera m_TagString: MainCamera @@ -282,27 +291,29 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &8667386838808186338 +--- !u!4 &7801516489716195986 Transform: m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 8667386838808186338, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8667386838808186343} + m_GameObject: {fileID: 7801516489716195990} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 1.9, z: 0} + m_LocalPosition: {x: 0, y: 1.9, z: -7.4} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] - m_Father: {fileID: 8667386836911801602} + m_Father: {fileID: 7801516488764644385} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!20 &8667386838808186341 +--- !u!20 &7801516489716195989 Camera: m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 8667386838808186341, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8667386838808186343} + m_GameObject: {fileID: 7801516489716195990} m_Enabled: 1 serializedVersion: 2 m_ClearFlags: 1 @@ -339,27 +350,29 @@ Camera: m_OcclusionCulling: 1 m_StereoConvergence: 10 m_StereoSeparation: 0.022 ---- !u!81 &8667386838808186340 +--- !u!81 &7801516489716195987 AudioListener: m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 8667386838808186340, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8667386838808186343} + m_GameObject: {fileID: 7801516489716195990} m_Enabled: 1 ---- !u!114 &8688770579720177661 +--- !u!114 &7801516489716195988 MonoBehaviour: m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 8688770579720177661, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8667386838808186343} + m_GameObject: {fileID: 7801516489716195990} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 948f4100a11a5c24981795d21301da5c, type: 3} m_Name: m_EditorClassIdentifier: - volumeTrigger: {fileID: 8667386838808186338} + volumeTrigger: {fileID: 7801516489716195986} volumeLayer: serializedVersion: 2 m_Bits: 256 @@ -407,3 +420,199 @@ MonoBehaviour: m_BeforeTransparentBundles: [] m_BeforeStackBundles: [] m_AfterStackBundles: [] +--- !u!1 &7801516489801019558 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 5627282298304387526, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7801516489801019557} + - component: {fileID: 7801516489801019554} + - component: {fileID: 7801516489801019555} + - component: {fileID: 7801516489801019556} + m_Layer: 0 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &7801516489801019557 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 6104960137431343203, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7801516489801019558} + 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_Children: [] + m_Father: {fileID: 7801516488764644385} + m_RootOrder: 1 + 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!223 &7801516489801019554 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 5327314824195544201, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7801516489801019558} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 1 + m_Camera: {fileID: 7801516489716195989} + m_PlaneDistance: 0.4 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &7801516489801019555 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 7753747927545331008, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7801516489801019558} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!114 &7801516489801019556 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 680770354065552892, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7801516489801019558} + 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!1 &7801516490449566175 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7801516490449566174} + - component: {fileID: 7801516490449566171} + - component: {fileID: 7801516490449566172} + - component: {fileID: 7801516490449566173} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7801516490449566174 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7801516490449566175} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.3, y: 0.75, z: 0} + m_LocalScale: {x: 0.3, y: 0.2, z: 0.6} + m_Children: [] + m_Father: {fileID: 7801516489048978513} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &7801516490449566171 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7801516490449566175} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &7801516490449566172 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7801516490449566175} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 4ad4d16dd3559344d92514608ecc8a44, 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: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!65 &7801516490449566173 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7801516490449566175} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index cdc98d6..970bd42 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -121,6 +121,130 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} +--- !u!1 &490917657 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 490917663} + - component: {fileID: 490917662} + - component: {fileID: 490917661} + - component: {fileID: 490917660} + - component: {fileID: 490917659} + - component: {fileID: 490917658} + m_Layer: 0 + m_Name: Test Cube + m_TagString: Ground + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &490917658 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 490917657} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c7be605e9d134b742b0269485b577d6a, type: 3} + m_Name: + m_EditorClassIdentifier: + objectType: 2 +--- !u!54 &490917659 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 490917657} + serializedVersion: 2 + m_Mass: 100 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 126 + m_CollisionDetection: 0 +--- !u!65 &490917660 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 490917657} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &490917661 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 490917657} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &490917662 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 490917657} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &490917663 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 490917657} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 5.61, y: 0.6, z: 0.01} + 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!1 &763829262 GameObject: m_ObjectHideFlags: 0 @@ -209,7 +333,7 @@ Transform: m_GameObject: {fileID: 763829262} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 25, y: 0.2, z: 25} + m_LocalScale: {x: 25, y: 0.2, z: 5} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 2 @@ -306,80 +430,6 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} ---- !u!1001 &1189879678 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 8667386836911801602, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, - type: 3} - propertyPath: m_RootOrder - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8667386836911801602, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, - type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8667386836911801602, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, - type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8667386836911801602, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, - type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8667386836911801602, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8667386836911801602, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8667386836911801602, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, - type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8667386836911801602, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8667386836911801602, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8667386836911801602, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8667386836911801602, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8667386836911801603, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, - type: 3} - propertyPath: jump - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 8667386836911801605, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, - type: 3} - propertyPath: m_Name - value: Player - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, type: 3} --- !u!1001 &7152489398920308657 PrefabInstance: m_ObjectHideFlags: 0 @@ -449,3 +499,72 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: b3358042f02e73e408eb7939bcbda893, type: 3} +--- !u!1001 &7801516488729611279 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 7801516488764644385, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7801516488764644385, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7801516488764644385, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7801516488764644385, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7801516488764644385, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7801516488764644385, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7801516488764644385, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7801516488764644385, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7801516488764644385, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7801516488764644385, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7801516488764644385, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7801516488764644390, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, + type: 3} + propertyPath: m_Name + value: Player + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 4f1a4eb0e633f7740b9c4928cf54ce35, type: 3} diff --git a/Assets/Scripts/ObjectManager.cs b/Assets/Scripts/ObjectManager.cs new file mode 100644 index 0000000..1b40992 --- /dev/null +++ b/Assets/Scripts/ObjectManager.cs @@ -0,0 +1,23 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class ObjectManager : MonoBehaviour +{ + public enum ObjectType {Nothing, Door, PushPull, Drag, Ladder}; + public ObjectType objectType = ObjectType.Nothing; + private Rigidbody rigidBody; + + + // Start is called before the first frame update + void Start() + { + rigidBody = GetComponent(); + } + + // Update is called once per frame + void Update() + { + + } +} diff --git a/Assets/Scripts/PlayerManager.cs b/Assets/Scripts/PlayerManager.cs index ae8bf22..e04c048 100644 --- a/Assets/Scripts/PlayerManager.cs +++ b/Assets/Scripts/PlayerManager.cs @@ -35,11 +35,6 @@ public class PlayerManager : MonoBehaviour RunSwitch(); } - void FixedUpdate() - { - Rotate(); - } - void RunSwitch() { if (Input.GetAxisRaw("Run") > 0) @@ -56,7 +51,6 @@ public class PlayerManager : MonoBehaviour { rigidBody.MovePosition( transform.position + - (transform.forward * (run ? runSpeed : speed) * Input.GetAxis("Vertical") * Time.deltaTime) + (transform.right * (run ? runSpeed : speed) * Input.GetAxis("Horizontal") * Time.deltaTime) + jumpPower ); @@ -73,47 +67,9 @@ public class PlayerManager : MonoBehaviour } } - void Rotate() - { - rigidBody.freezeRotation = false; - transform.Rotate(new Vector3(0, rotateSpeed * Input.GetAxis("Mouse X") * mouseSensitive * Time.deltaTime, 0)); - if ( - ((playerCamera.transform.localEulerAngles.x >= 270 && playerCamera.transform.localEulerAngles.x <= 360) && - playerCamera.transform.localEulerAngles.y == 0 && - playerCamera.transform.localEulerAngles.z == 0) || - ((playerCamera.transform.localEulerAngles.x <= 90 && playerCamera.transform.localEulerAngles.x >= 0) && - playerCamera.transform.localEulerAngles.y == 0 && - playerCamera.transform.localEulerAngles.z == 0) - ) - { - playerCamera.transform.Rotate(new Vector3(rotateSpeed * -Input.GetAxis("Mouse Y") * mouseSensitive * Time.deltaTime, 0, 0)); - } - else if ( - ((playerCamera.transform.localEulerAngles.x >= 270 && playerCamera.transform.localEulerAngles.x <= 360) && - playerCamera.transform.localEulerAngles.y == 180 && - playerCamera.transform.localEulerAngles.z == 180) - ) - { - playerCamera.transform.Rotate(new Vector3(rotateSpeed * (-Input.GetAxis("Mouse Y") > 0 ? -Input.GetAxis("Mouse Y") : 0) * mouseSensitive * Time.deltaTime, 0, 0)); - } - else if ( - ((playerCamera.transform.localEulerAngles.x <= 90 && playerCamera.transform.localEulerAngles.x >= 0) && - playerCamera.transform.localEulerAngles.y == 180 && - playerCamera.transform.localEulerAngles.z == 180) - ) - { - playerCamera.transform.Rotate(new Vector3(rotateSpeed * (-Input.GetAxis("Mouse Y") < 0 ? -Input.GetAxis("Mouse Y") : 0) * mouseSensitive * Time.deltaTime, 0, 0)); - } - else - { - playerCamera.transform.Rotate(new Vector3(rotateSpeed * -Input.GetAxis("Mouse Y") * mouseSensitive * Time.deltaTime, 0, 0)); - } - rigidBody.freezeRotation = true; - } - public void OnTriggerEnter(Collider other) { - if (other.tag == "Ground") + if (other.tag == "Ground" || other.tag == "Objects") { jumpPower = Vector3.zero; onGround = true; @@ -122,7 +78,7 @@ public class PlayerManager : MonoBehaviour public void OnTriggerExit(Collider other) { - if (other.tag == "Ground") + if (other.tag == "Ground" || other.tag == "Objects") { onGround = false; } diff --git a/Assets/Textures/New Material.mat b/Assets/Textures/New Material.mat new file mode 100644 index 0000000..1f3a442 --- /dev/null +++ b/Assets/Textures/New Material.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: New Material + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0, g: 0, b: 0, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}