diff --git a/Assets/Scenes/Noahs kælder.unity b/Assets/Scenes/Noahs kælder.unity index 193b5fd..97b9db4 100644 --- a/Assets/Scenes/Noahs kælder.unity +++ b/Assets/Scenes/Noahs kælder.unity @@ -251,7 +251,7 @@ BoxCollider2D: m_CallbackLayers: serializedVersion: 2 m_Bits: 4294967295 - m_IsTrigger: 1 + m_IsTrigger: 0 m_UsedByEffector: 0 m_UsedByComposite: 0 m_Offset: {x: 0, y: 0} @@ -383,7 +383,7 @@ SpriteRenderer: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1147379266} - m_Enabled: 1 + m_Enabled: 0 m_CastShadows: 0 m_ReceiveShadows: 0 m_DynamicOccludee: 1 @@ -454,6 +454,8 @@ GameObject: - component: {fileID: 1517788315} - component: {fileID: 1517788314} - component: {fileID: 1517788313} + - component: {fileID: 1517788316} + - component: {fileID: 1517788317} m_Layer: 0 m_Name: Cooker m_TagString: Untagged @@ -490,7 +492,7 @@ BoxCollider2D: m_CallbackLayers: serializedVersion: 2 m_Bits: 4294967295 - m_IsTrigger: 1 + m_IsTrigger: 0 m_UsedByEffector: 0 m_UsedByComposite: 0 m_Offset: {x: 0, y: 0} @@ -513,7 +515,7 @@ SpriteRenderer: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1517788312} - m_Enabled: 0 + m_Enabled: 1 m_CastShadows: 0 m_ReceiveShadows: 0 m_DynamicOccludee: 1 @@ -573,6 +575,45 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1517788316 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1517788312} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84e0c3f7dac20fb428c544f192588d80, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!50 &1517788317 +Rigidbody2D: + serializedVersion: 4 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1517788312} + 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_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_Interpolate: 0 + m_SleepingMode: 1 + m_CollisionDetection: 0 + m_Constraints: 7 --- !u!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Cooking.cs b/Assets/Scripts/Cooking.cs index dc84987..8f0699e 100644 --- a/Assets/Scripts/Cooking.cs +++ b/Assets/Scripts/Cooking.cs @@ -8,11 +8,26 @@ public class Cooking : MonoBehaviour void GetIngredients() { + // foreach (GameObject ingredient in currentCollisions) { + // Debug.Log(ingredient.name); + // } + + return currentCollisions } void Update() { - GetIngredients() + GetIngredients(); } + + // Keep track of ingredients going on and off the cooker. + List currentCollisions = new List (); + private void OnTriggerEnter2D(Collider2D other) { + currentCollisions.Add (other.gameObject); + } + private void OnTriggerExit2D(Collider2D other) { + currentCollisions.Remove (other.gameObject); + } + } diff --git a/ProjectSettings/DynamicsManager.asset b/ProjectSettings/DynamicsManager.asset index 72d1430..72cb792 100644 --- a/ProjectSettings/DynamicsManager.asset +++ b/ProjectSettings/DynamicsManager.asset @@ -3,8 +3,8 @@ --- !u!55 &1 PhysicsManager: m_ObjectHideFlags: 0 - serializedVersion: 13 - m_Gravity: {x: 0, y: -9.81, z: 0} + serializedVersion: 14 + m_Gravity: {x: 0, y: 0, z: -9.81} m_DefaultMaterial: {fileID: 0} m_BounceThreshold: 2 m_DefaultMaxDepenetrationVelocity: 10 @@ -19,9 +19,10 @@ PhysicsManager: m_ClothInterCollisionStiffness: 0.2 m_ContactsGeneration: 1 m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - m_AutoSimulation: 1 + m_SimulationMode: 0 m_AutoSyncTransforms: 0 m_ReuseCollisionCallbacks: 1 + m_InvokeCollisionCallbacks: 1 m_ClothInterCollisionSettingsToggle: 0 m_ClothGravity: {x: 0, y: -9.81, z: 0} m_ContactPairsMode: 0 @@ -33,5 +34,6 @@ PhysicsManager: m_FrictionType: 0 m_EnableEnhancedDeterminism: 0 m_EnableUnifiedHeightmaps: 1 + m_ImprovedPatchFriction: 0 m_SolverType: 0 m_DefaultMaxAngularSpeed: 50