]> git.lizzy.rs Git - SuperMouseAdventure.git/commitdiff
Merge branch 'main' of https://github.com/EliasFleckenstein03/SuperMouseAdventure
authorKG0104 <konstantin.gerlach@kabelmail.de>
Sat, 30 Oct 2021 16:14:50 +0000 (18:14 +0200)
committerKG0104 <konstantin.gerlach@kabelmail.de>
Sat, 30 Oct 2021 16:14:50 +0000 (18:14 +0200)
2DGame/Assets/Scenes/(1) Green_Idyll/green_idyll_10.unity
2DGame/Assets/Scripts/Enemies/EnemyCollision.cs
2DGame/Assets/Scripts/Mouse/JumpOnEnemies.cs
2DGame/Assets/Scripts/Mouse/PowerUps.cs
2DGame/ProjectSettings/TagManager.asset

index 67210f8d669ec751928f356b8cb5c29e265558d1..69c52cd402f55eb94fe0c852f6e118f90b7bfdb2 100644 (file)
@@ -9550,8 +9550,6 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 86228eec2ce28124cae697faf008036d, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
-  gardenCheese: {fileID: 405401497}
-  mouseRenderer: {fileID: 936765970}
   mouseIsGardener: 0
 --- !u!114 &936765981
 MonoBehaviour:
@@ -9625,7 +9623,7 @@ GameObject:
   - component: {fileID: 972365584}
   m_Layer: 0
   m_Name: GroundCheck
-  m_TagString: Untagged
+  m_TagString: GroundCheck
   m_Icon: {fileID: 7250588514170254948, guid: 0000000000000000d000000000000000, type: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
@@ -9674,6 +9672,7 @@ MonoBehaviour:
   m_EditorClassIdentifier: 
   mouse: {fileID: 936765968}
   knockBackValue: 30
+  stunned: 0
 --- !u!1 &994169121
 GameObject:
   m_ObjectHideFlags: 0
index 4a29db33ce905512ad8febd34222e15ddfb859ab..e15390a1601034db21664509cb637a945012230e 100644 (file)
@@ -16,7 +16,9 @@ public class EnemyCollision : MonoBehaviour
 
     EnemyScript eS;
 
-    public float flashingTime = 0.3f;
+    JumpOnEnemies jumpOnEnemies;
+
+    public float flashingTime = 0.1f;
 
     private bool invulnerable = false;
 
@@ -29,6 +31,7 @@ public class EnemyCollision : MonoBehaviour
         powerUps = mouse.GetComponent<PowerUps>();
         health = mouse.GetComponent<Health>();
         eS = GetComponent<EnemyScript>();
+        jumpOnEnemies = GameObject.FindGameObjectWithTag("GroundCheck").GetComponent<JumpOnEnemies>();
     }
 
     private void OnCollisionEnter2D(Collision2D collision)
@@ -55,6 +58,7 @@ public class EnemyCollision : MonoBehaviour
     IEnumerator GetInvincible()
     {
         invulnerable = true;
+        jumpOnEnemies.stunned = true;
         Physics2D.IgnoreLayerCollision(7, 8, true);
         for (int i = 0; i < 4; i++)
         {
@@ -66,8 +70,7 @@ public class EnemyCollision : MonoBehaviour
             yield return new WaitForSeconds(flashingTime);
         }
         Physics2D.IgnoreLayerCollision(7, 8, false);
-        spriteRenderer.enabled = true;
-        trailRenderer.enabled = true;
+        jumpOnEnemies.stunned = false;
         invulnerable = false;
     }
 }
index 5fdee358924a76316109511f3305287be2939bbd..c71f282acbe951f6744708f88b17718234f07fb0 100644 (file)
@@ -5,15 +5,17 @@ using UnityEngine;
 public class JumpOnEnemies : MonoBehaviour
 {
     EnemyScript enemyScript;
-    
+
     [SerializeField]
     GameObject mouse;
 
     public float knockBackValue = 30;
 
+    public bool stunned = false;
+
     private void OnTriggerEnter2D(Collider2D collision)
     {
-        if (collision.gameObject.CompareTag("Enemy"))
+        if (collision.gameObject.CompareTag("Enemy") && !stunned)
         {
             enemyScript = collision.gameObject.GetComponent<EnemyScript>();
 
index 738ce6a2ad5170694f9a2bd57d65bc1ac507d3d8..024ac44427081583ad63f7050192b69727d0f897 100644 (file)
@@ -4,9 +4,6 @@ using UnityEngine;
 
 public class PowerUps : MonoBehaviour
 {
-    public GameObject gardenCheese;
-    public SpriteRenderer mouseRenderer;
-
     public bool mouseIsGardener;
 
     public void OnTriggerEnter2D(Collider2D collision)
index c98705613bc516a9d1c1d0c224c85e76477fa701..12e24e10fb3e8c0193a742df23df993263644b92 100644 (file)
@@ -17,6 +17,7 @@ TagManager:
   - Thorn
   - Bullet
   - Stamp
+  - GroundCheck
   layers:
   - Default
   - TransparentFX