]> git.lizzy.rs Git - SuperMouseAdventure.git/commitdiff
Snail can no longer be attacked before the actual fight starts
authorKG0104 <76601263+KG0104@users.noreply.github.com>
Sun, 26 Sep 2021 10:21:39 +0000 (12:21 +0200)
committerKG0104 <76601263+KG0104@users.noreply.github.com>
Sun, 26 Sep 2021 10:21:39 +0000 (12:21 +0200)
2DGame/Assets/Scripts/Dialogue/BossDialogue.cs
2DGame/Assets/Scripts/Enemies/Boss/Boss.cs

index 7968672e3e4dd2a836795661e03c6a6b2fe1f2af..b4042e666f6c69cf49afc4c80a6dfcab96832730 100644 (file)
@@ -73,6 +73,7 @@ public class BossDialogue : MonoBehaviour
             dialogueBox.SetActive(false);
             SpeechBubble.SetActive(false);
             boss.bossfight = true;
+            bossObject.GetComponent<Rigidbody2D>().constraints = RigidbodyConstraints2D.FreezeRotation;
             mouse.GetComponent<Rigidbody2D>().constraints = RigidbodyConstraints2D.FreezeRotation;
             mouse.GetComponent<MouseController>().enabled = true;
             FindObjectOfType<AudioManager>().Play("snail_fight");
index 68975e2a7415f44b5d06d8b52e6a0f485250c18a..d31b28a14d4ca617d75d075d25f1366b8ef07fd9 100644 (file)
@@ -22,6 +22,11 @@ public class Boss : MonoBehaviour
     public Sprite fullHeart;
     public Sprite emptyHeart;
 
+    private void Start()
+    {
+        GetComponent<Rigidbody2D>().constraints = RigidbodyConstraints2D.FreezeAll;
+    }
+
     // Update is called once per frame
     void Update()
     {