Commit 1f5261f4 authored by astatham's avatar astatham
Browse files

Re-fixed moving target spawn bugs

parent eca6c009
...@@ -13,12 +13,15 @@ public class MovingTarget : MonoBehaviour { ...@@ -13,12 +13,15 @@ public class MovingTarget : MonoBehaviour {
previousPos = -9f; previousPos = -9f;
if (gameObject.activeSelf){ if (gameObject.activeSelf){
PieTarget[] targets = gameObject.transform.parent.GetComponentsInChildren<PieTarget>(); PieTarget[] targets = gameObject.transform.parent.GetComponentsInChildren<PieTarget>();
for (int i = 0; i < gameObject.transform.parent.childCount; i++) print(targets.Length);
for (int i = 0; i < targets.Length; i++)
{ {
targets[i].gameObject.SetActive(false); targets[i].gameObject.SetActive(false);
//targets[i].gameObject.transform.GetChild(0).gameObject.SetActive(false);
} }
} }
gameObject.SetActive(true); gameObject.SetActive(true);
//gameObject.transform.GetChild(0).gameObject.SetActive(true);
} }
// Update is called once per frame // Update is called once per frame
void Update() void Update()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment