]> git.cameronkatri.com Git - gmtk-gamejam.git/commitdiff
PlayerHoop log on hit
authorCameron Katri <me@cameronkatri.com>
Sat, 12 Jun 2021 20:42:21 +0000 (16:42 -0400)
committerCameron Katri <me@cameronkatri.com>
Sat, 12 Jun 2021 20:42:21 +0000 (16:42 -0400)
Assets/Scenes/Main.unity
Assets/Scripts/Controllers/Hoop.cs [new file with mode: 0644]
Assets/Scripts/Controllers/Hoop.cs.meta [new file with mode: 0644]

index 89790712e3cf667cafcaaf8cf3241a5a6a393ca4..0e8dd5164f7aba28fc080c7534f42b186d13837c 100644 (file)
@@ -298,6 +298,77 @@ Transform:
   m_CorrespondingSourceObject: {fileID: 2106494524751008833, guid: b2939f2eae52d074b81e81fccdde88f9, type: 3}
   m_PrefabInstance: {fileID: 1402386184}
   m_PrefabAsset: {fileID: 0}
+--- !u!1 &614591299 stripped
+GameObject:
+  m_CorrespondingSourceObject: {fileID: 2106494524751008836, guid: b2939f2eae52d074b81e81fccdde88f9, type: 3}
+  m_PrefabInstance: {fileID: 1402386184}
+  m_PrefabAsset: {fileID: 0}
+--- !u!61 &614591300
+BoxCollider2D:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 614591299}
+  m_Enabled: 1
+  m_Density: 1
+  m_Material: {fileID: 0}
+  m_IsTrigger: 1
+  m_UsedByEffector: 0
+  m_UsedByComposite: 0
+  m_Offset: {x: -0.005651191, y: -0.104769394}
+  m_SpriteTilingProperty:
+    border: {x: 0, y: 0, z: 0, w: 0}
+    pivot: {x: 0.5, y: 0.5}
+    oldSize: {x: 0.32, y: 0.32}
+    newSize: {x: 0.32, y: 0.32}
+    adaptiveTilingThreshold: 0.5
+    drawMode: 0
+    adaptiveTiling: 0
+  m_AutoTiling: 0
+  serializedVersion: 2
+  m_Size: {x: 0.14921531, y: 0.030544288}
+  m_EdgeRadius: 0
+--- !u!61 &614591301
+BoxCollider2D:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 614591299}
+  m_Enabled: 1
+  m_Density: 1
+  m_Material: {fileID: 0}
+  m_IsTrigger: 1
+  m_UsedByEffector: 0
+  m_UsedByComposite: 0
+  m_Offset: {x: -0.0056511946, y: 0.005704716}
+  m_SpriteTilingProperty:
+    border: {x: 0, y: 0, z: 0, w: 0}
+    pivot: {x: 0.5, y: 0.5}
+    oldSize: {x: 0.32, y: 0.32}
+    newSize: {x: 0.32, y: 0.32}
+    adaptiveTilingThreshold: 0.5
+    drawMode: 0
+    adaptiveTiling: 0
+  m_AutoTiling: 0
+  serializedVersion: 2
+  m_Size: {x: 0.14921531, y: 0.050745383}
+  m_EdgeRadius: 0
+--- !u!114 &614591307
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 614591299}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 40e5d6a883d14c7fb60913ec2fc3009c, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  Rim: {fileID: 614591300}
+  Net: {fileID: 614591301}
 --- !u!1001 &700993592
 PrefabInstance:
   m_ObjectHideFlags: 0
@@ -315,11 +386,11 @@ PrefabInstance:
       objectReference: {fileID: 0}
     - target: {fileID: 5143626018439341592, guid: 2485406c33a7d4f5481ce936cc9b162e, type: 3}
       propertyPath: m_LocalPosition.x
-      value: 3.5
+      value: 0.23
       objectReference: {fileID: 0}
     - target: {fileID: 5143626018439341592, guid: 2485406c33a7d4f5481ce936cc9b162e, type: 3}
       propertyPath: m_LocalPosition.y
-      value: 5.5
+      value: 5.17
       objectReference: {fileID: 0}
     - target: {fileID: 5143626018439341592, guid: 2485406c33a7d4f5481ce936cc9b162e, type: 3}
       propertyPath: m_LocalPosition.z
@@ -496,6 +567,8 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   ball: {fileID: 707826158}
+  PlayerHoop: {fileID: 614591307}
+  EnemyHoop: {fileID: 0}
 --- !u!4 &1189511746 stripped
 Transform:
   m_CorrespondingSourceObject: {fileID: 6095859834264611321, guid: c64ad9b908cb44602b3d13a74aef751f, type: 3}
diff --git a/Assets/Scripts/Controllers/Hoop.cs b/Assets/Scripts/Controllers/Hoop.cs
new file mode 100644 (file)
index 0000000..58f7130
--- /dev/null
@@ -0,0 +1,19 @@
+using System;
+using UnityEngine;
+
+namespace Controllers
+{
+       public class Hoop : MonoBehaviour
+       {
+               [SerializeField] private BoxCollider2D Rim;
+               [SerializeField] private BoxCollider2D Net;
+               
+               private void OnTriggerEnter2D(Collider2D other)
+               {
+                       if (other.GetComponent<Ball>() == null) return;
+                       
+                       if (Rim.IsTouching(other) && Net.IsTouching(other))
+                               Debug.Log("Swish!");
+               }
+       }
+}
\ No newline at end of file
diff --git a/Assets/Scripts/Controllers/Hoop.cs.meta b/Assets/Scripts/Controllers/Hoop.cs.meta
new file mode 100644 (file)
index 0000000..29125c3
--- /dev/null
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 40e5d6a883d14c7fb60913ec2fc3009c
+timeCreated: 1623524972
\ No newline at end of file