Fixed a few bugs involving the party or enemy not being destroyed during a game over or victory state respectively
This commit is contained in:
@@ -520,7 +520,7 @@ GameObject:
|
||||
- component: {fileID: 253563189}
|
||||
m_Layer: 0
|
||||
m_Name: Party Member Position
|
||||
m_TagString: Untagged
|
||||
m_TagString: Party
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -945,7 +945,7 @@ GameObject:
|
||||
- component: {fileID: 584866349}
|
||||
m_Layer: 0
|
||||
m_Name: Party Member Position
|
||||
m_TagString: Untagged
|
||||
m_TagString: Party
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1236,7 +1236,7 @@ GameObject:
|
||||
- component: {fileID: 901586392}
|
||||
m_Layer: 0
|
||||
m_Name: Party Member Position
|
||||
m_TagString: Untagged
|
||||
m_TagString: Party
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1478,7 +1478,7 @@ GameObject:
|
||||
- component: {fileID: 982463267}
|
||||
m_Layer: 0
|
||||
m_Name: Party Member Position 3
|
||||
m_TagString: Untagged
|
||||
m_TagString: Party
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1590,7 +1590,7 @@ GameObject:
|
||||
- component: {fileID: 1054126017}
|
||||
m_Layer: 0
|
||||
m_Name: Party Member Position 2
|
||||
m_TagString: Untagged
|
||||
m_TagString: Party
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -2418,7 +2418,7 @@ GameObject:
|
||||
- component: {fileID: 1537576151}
|
||||
m_Layer: 0
|
||||
m_Name: Party Member Position 4
|
||||
m_TagString: Untagged
|
||||
m_TagString: Party
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -2579,7 +2579,7 @@ GameObject:
|
||||
- component: {fileID: 1729514559}
|
||||
m_Layer: 0
|
||||
m_Name: Party Member Position 1
|
||||
m_TagString: Untagged
|
||||
m_TagString: Party
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -2692,7 +2692,7 @@ GameObject:
|
||||
- component: {fileID: 1887744310}
|
||||
m_Layer: 0
|
||||
m_Name: Party Member Position
|
||||
m_TagString: Untagged
|
||||
m_TagString: Party
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
|
||||
@@ -90,7 +90,7 @@ public class GMScript : MonoBehaviour
|
||||
EnemyHealthText.text = enemyHealth.ToString();
|
||||
PartyHealthText.text = partyHealth.ToString();
|
||||
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
if (Input.GetMouseButtonDown(0) && gameover == false && victory == false)
|
||||
{
|
||||
Vector3 mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
|
||||
Vector2 mousePos2D = new Vector2(mousePos.x, mousePos.y);
|
||||
@@ -128,10 +128,8 @@ public class GMScript : MonoBehaviour
|
||||
{
|
||||
partyHealth = 0;
|
||||
|
||||
for(int i = 0; i < partySize; i++)
|
||||
{
|
||||
Destroy(GameObject.FindWithTag("Party"));
|
||||
}
|
||||
GameObject[] party = GameObject.FindGameObjectsWithTag("Party");
|
||||
foreach(GameObject memeber in party) GameObject.Destroy(memeber);
|
||||
|
||||
print("The Super Robo Squad has been destroyed! Try again!");
|
||||
|
||||
@@ -143,7 +141,8 @@ public class GMScript : MonoBehaviour
|
||||
{
|
||||
enemyHealth = 0;
|
||||
|
||||
Destroy(GameObject.FindWithTag("Enemy"));
|
||||
GameObject[] enemy = GameObject.FindGameObjectsWithTag("Enemy");
|
||||
foreach(GameObject parts in enemy) GameObject.Destroy(parts);
|
||||
|
||||
print("The enemy robot has been destroyed! Congrats!");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user