From 3c599999e8679ec496fabda1fdd84bb9105f5cd0 Mon Sep 17 00:00:00 2001 From: Claire Peta Date: Thu, 21 Mar 2019 14:57:05 +1100 Subject: [PATCH] - Fix object collision for new block - Adjust jump onto stump - Link levels together --- Assets/Prefabs/Character.prefab | 22 ++++- Assets/Prefabs/End Portal.prefab | 2 +- Assets/Prefabs/Stump.prefab | 3 +- Assets/Scenes/TuteLevelFive.unity | 112 ++++------------------ Assets/Scenes/TuteLevelFour.unity | 11 ++- Assets/Scenes/TuteLevelOne.unity | 7 +- Assets/Scenes/TuteLevelThree.unity | 13 ++- Assets/Scenes/TuteLevelTwo.unity | 16 +++- Assets/Scripts/Character.cs | 24 ++--- ProjectSettings/EditorBuildSettings.asset | 4 +- ProjectSettings/TagManager.asset | 4 +- 11 files changed, 94 insertions(+), 124 deletions(-) diff --git a/Assets/Prefabs/Character.prefab b/Assets/Prefabs/Character.prefab index e10e296..4a4e983 100644 --- a/Assets/Prefabs/Character.prefab +++ b/Assets/Prefabs/Character.prefab @@ -58,7 +58,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 2100000, guid: 646f348902cc6ca418957e91ad5ca9f6, type: 2} + - {fileID: 2100000, guid: ebc403a16f8803f4cb7b1fca470fa88d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -149,7 +149,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 2100000, guid: 646f348902cc6ca418957e91ad5ca9f6, type: 2} + - {fileID: 2100000, guid: ebc403a16f8803f4cb7b1fca470fa88d, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -193,6 +193,7 @@ GameObject: - component: {fileID: 7426725930156175971} - component: {fileID: 2862111851184665482} - component: {fileID: 2631002120179805110} + - component: {fileID: 315805078} m_Layer: 0 m_Name: Character m_TagString: Untagged @@ -227,6 +228,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 73c2eff8a9a01a44bb9b2c007539fc60, type: 3} m_Name: m_EditorClassIdentifier: + nextScene: TuteLevelThree CurrentBlock: {fileID: 0} Ignore: serializedVersion: 2 @@ -244,6 +246,22 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: character: {fileID: 2862111851184665482} +--- !u!54 &315805078 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7426725930156175983} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 0 + m_IsKinematic: 1 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 --- !u!1 &8963196030949126965 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Prefabs/End Portal.prefab b/Assets/Prefabs/End Portal.prefab index 3fb1c6b..eb0534b 100644 --- a/Assets/Prefabs/End Portal.prefab +++ b/Assets/Prefabs/End Portal.prefab @@ -18335,7 +18335,7 @@ SphereCollider: m_IsTrigger: 1 m_Enabled: 1 serializedVersion: 2 - m_Radius: 0.1 + m_Radius: 0.5 m_Center: {x: 0, y: 0.1, z: 0} --- !u!1 &1707369581171242 GameObject: diff --git a/Assets/Prefabs/Stump.prefab b/Assets/Prefabs/Stump.prefab index e07d651..cff2ddf 100644 --- a/Assets/Prefabs/Stump.prefab +++ b/Assets/Prefabs/Stump.prefab @@ -158,4 +158,5 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 1a69d64be9f9e8543b4278d7f139f6f1, type: 3} m_Name: m_EditorClassIdentifier: - VisualHeight: 0.5 + VisualOffset: {x: 0, y: -0.5, z: 0} + _isWalkable: 1 diff --git a/Assets/Scenes/TuteLevelFive.unity b/Assets/Scenes/TuteLevelFive.unity index 3efe8db..a5efd38 100644 --- a/Assets/Scenes/TuteLevelFive.unity +++ b/Assets/Scenes/TuteLevelFive.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44657874, g: 0.49641258, b: 0.5748172, a: 1} + m_IndirectSpecularColor: {r: 0.4465785, g: 0.49641222, b: 0.57481694, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -1512,6 +1512,21 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 2862111851184665482, guid: c176f4ae8f7b4074db99b27b2e015a2a, + type: 3} + propertyPath: nextScene + value: + objectReference: {fileID: 0} + - target: {fileID: 1116712125457233699, guid: c176f4ae8f7b4074db99b27b2e015a2a, + type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 2100000, guid: ebc403a16f8803f4cb7b1fca470fa88d, type: 2} + - target: {fileID: 5491211767220478932, guid: c176f4ae8f7b4074db99b27b2e015a2a, + type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 2100000, guid: ebc403a16f8803f4cb7b1fca470fa88d, type: 2} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: c176f4ae8f7b4074db99b27b2e015a2a, type: 3} --- !u!4 &432890452 stripped @@ -3073,97 +3088,6 @@ Transform: type: 3} m_PrefabInstance: {fileID: 1961001016} m_PrefabAsset: {fileID: 0} ---- !u!1 &1239388820 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1239388824} - - component: {fileID: 1239388823} - - component: {fileID: 1239388822} - - component: {fileID: 1239388821} - m_Layer: 0 - m_Name: Portal - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!135 &1239388821 -SphereCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1239388820} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Radius: 0.5 - m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &1239388822 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1239388820} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 2100000, guid: daf773d386d95cc4db00645767089871, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 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 &1239388823 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1239388820} - m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} ---- !u!4 &1239388824 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1239388820} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 11.5, y: 1.25, z: 0} - m_LocalScale: {x: 0.1, y: 1.5, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 6 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &1256219995 PrefabInstance: m_ObjectHideFlags: 0 @@ -4128,8 +4052,8 @@ GameObject: - component: {fileID: 1691679948} - component: {fileID: 1691679947} m_Layer: 0 - m_Name: New Block - m_TagString: Untagged + m_Name: Jump + m_TagString: New Block m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Assets/Scenes/TuteLevelFour.unity b/Assets/Scenes/TuteLevelFour.unity index 05c8624..c52614a 100644 --- a/Assets/Scenes/TuteLevelFour.unity +++ b/Assets/Scenes/TuteLevelFour.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44657874, g: 0.49641258, b: 0.5748172, a: 1} + m_IndirectSpecularColor: {r: 0.4465785, g: 0.49641222, b: 0.57481694, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -623,6 +623,11 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 2862111851184665482, guid: c176f4ae8f7b4074db99b27b2e015a2a, + type: 3} + propertyPath: nextScene + value: TuteLevelFive + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: c176f4ae8f7b4074db99b27b2e015a2a, type: 3} --- !u!1001 &417912681 @@ -1811,8 +1816,8 @@ GameObject: - component: {fileID: 1571819309} - component: {fileID: 1571819308} m_Layer: 0 - m_Name: New Block - m_TagString: Untagged + m_Name: For-Loop + m_TagString: New Block m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Assets/Scenes/TuteLevelOne.unity b/Assets/Scenes/TuteLevelOne.unity index d492afd..a9e4938 100644 --- a/Assets/Scenes/TuteLevelOne.unity +++ b/Assets/Scenes/TuteLevelOne.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44657874, g: 0.49641258, b: 0.5748172, a: 1} + m_IndirectSpecularColor: {r: 0.4465785, g: 0.49641222, b: 0.57481694, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -630,6 +630,11 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 2862111851184665482, guid: c176f4ae8f7b4074db99b27b2e015a2a, + type: 3} + propertyPath: nextScene + value: TuteLevelTwo + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: c176f4ae8f7b4074db99b27b2e015a2a, type: 3} --- !u!1001 &1361092549 diff --git a/Assets/Scenes/TuteLevelThree.unity b/Assets/Scenes/TuteLevelThree.unity index ff38042..a2250e5 100644 --- a/Assets/Scenes/TuteLevelThree.unity +++ b/Assets/Scenes/TuteLevelThree.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44657874, g: 0.49641258, b: 0.5748172, a: 1} + m_IndirectSpecularColor: {r: 0.4465785, g: 0.49641222, b: 0.57481694, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -330,7 +330,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 2 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 33.65, y: -31.430002, z: -1.0040001} --- !u!1001 &364575177 PrefabInstance: @@ -537,6 +537,11 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 2862111851184665482, guid: c176f4ae8f7b4074db99b27b2e015a2a, + type: 3} + propertyPath: nextScene + value: TuteLevelFour + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: c176f4ae8f7b4074db99b27b2e015a2a, type: 3} --- !u!4 &461222511 stripped @@ -915,8 +920,8 @@ GameObject: - component: {fileID: 1606072382} - component: {fileID: 1606072381} m_Layer: 0 - m_Name: New Block - m_TagString: Untagged + m_Name: Rotate Right + m_TagString: New Block m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Assets/Scenes/TuteLevelTwo.unity b/Assets/Scenes/TuteLevelTwo.unity index e86bb41..1212949 100644 --- a/Assets/Scenes/TuteLevelTwo.unity +++ b/Assets/Scenes/TuteLevelTwo.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44657874, g: 0.49641258, b: 0.5748172, a: 1} + m_IndirectSpecularColor: {r: 0.4465785, g: 0.49641222, b: 0.57481694, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -125,8 +125,8 @@ GameObject: - component: {fileID: 237830961} - component: {fileID: 237830960} m_Layer: 0 - m_Name: New Block - m_TagString: Untagged + m_Name: Rotate Left + m_TagString: New Block m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -1193,6 +1193,16 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 1116712125457233699, guid: c176f4ae8f7b4074db99b27b2e015a2a, + type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 2100000, guid: ebc403a16f8803f4cb7b1fca470fa88d, type: 2} + - target: {fileID: 5491211767220478932, guid: c176f4ae8f7b4074db99b27b2e015a2a, + type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 2100000, guid: ebc403a16f8803f4cb7b1fca470fa88d, type: 2} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: c176f4ae8f7b4074db99b27b2e015a2a, type: 3} --- !u!1001 &2095735030 diff --git a/Assets/Scripts/Character.cs b/Assets/Scripts/Character.cs index 94f2806..3700bb2 100644 --- a/Assets/Scripts/Character.cs +++ b/Assets/Scripts/Character.cs @@ -1,12 +1,15 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; +using UnityEngine.SceneManagement; public class Character : MonoBehaviour { - #region Inspector Fields + public string nextScene; - [SerializeField] + #region Inspector Fields + + [SerializeField] [Tooltip ("Will move to this block at start, else will try and find a block below")] private Block CurrentBlock; @@ -68,17 +71,16 @@ public class Character : MonoBehaviour /// name of collided object void OnTriggerEnter (Collider other) { - if (other.gameObject.CompareTag ("New Block")) { + if (other.gameObject.tag == "New Block") { other.gameObject.SetActive (false); - Debug.Log ("You picked up a new coding block!"); - } - if (other.gameObject.CompareTag ("End Portal")) { - //Application.LoadLevel - Debug.Log ("You finished this level!"); + Debug.Log ("You picked up the new coding block " + other.gameObject.name + "!"); } - } - - + if (other.gameObject.name == "End Portal") { + other.GetComponent().enabled = false; + Debug.Log ("You finished this level!"); + SceneManager.LoadScene(nextScene); + } + } /// /// Rotates to point in specific direction based on current direction diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset index 0d2168f..79f56fc 100644 --- a/ProjectSettings/EditorBuildSettings.asset +++ b/ProjectSettings/EditorBuildSettings.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f6a30776960ebcaef3cb381bc36bd801d80e7c55dcea4fe60a9c9c9c05b31453 -size 268 +oid sha256:ffb477513ef8e072efb8d5b9158dfe75452e5d5bd2f3f1b7dce022aadfd59690 +size 735 diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index f6f2cd0..55173d7 100644 --- a/ProjectSettings/TagManager.asset +++ b/ProjectSettings/TagManager.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a033c1859dcfc74e0ab5011274b0c9d93ad6ffdf023c31bf86f75d7d4478832b -size 435 +oid sha256:62eccf8fc7b489c45e400510e49de0e20272e66576250b7b29d9adee3ee3c5f7 +size 403