Commit eca6c009 authored by astatham's avatar astatham
Browse files

(Hopefully) fixed moving target bug

parent bee443d7
......@@ -190,6 +190,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 30074518}
- component: {fileID: 30074519}
m_Layer: 0
m_Name: RightTarget
m_TagString: Untagged
......@@ -213,6 +214,17 @@ Transform:
m_Father: {fileID: 1046844653}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &30074519
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 30074517}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 53f76b8adcf2348e3a73cf1343cb10e5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &100312131
GameObject:
m_ObjectHideFlags: 0
......@@ -290,6 +302,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 198828739}
- component: {fileID: 198828740}
m_Layer: 0
m_Name: CentreTarget
m_TagString: Untagged
......@@ -313,6 +326,17 @@ Transform:
m_Father: {fileID: 1046844653}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &198828740
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 198828738}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 53f76b8adcf2348e3a73cf1343cb10e5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &234002383
GameObject:
m_ObjectHideFlags: 0
......@@ -505,6 +529,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 417111246}
- component: {fileID: 417111247}
m_Layer: 0
m_Name: CentreTarget
m_TagString: Untagged
......@@ -526,6 +551,17 @@ Transform:
m_Father: {fileID: 1393722532}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &417111247
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 417111245}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 53f76b8adcf2348e3a73cf1343cb10e5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &425617383
Prefab:
m_ObjectHideFlags: 0
......@@ -616,8 +652,8 @@ GameObject:
m_Component:
- component: {fileID: 488923753}
- component: {fileID: 488923752}
- component: {fileID: 488923755}
- component: {fileID: 488923754}
- component: {fileID: 488923755}
m_Layer: 0
m_Name: mime-1
m_TagString: Untagged
......@@ -728,6 +764,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 507094421}
- component: {fileID: 507094422}
m_Layer: 0
m_Name: CentreTarget
m_TagString: Untagged
......@@ -751,6 +788,17 @@ Transform:
m_Father: {fileID: 373884247}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &507094422
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 507094420}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 53f76b8adcf2348e3a73cf1343cb10e5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &510235118
GameObject:
m_ObjectHideFlags: 0
......@@ -1163,6 +1211,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 834739660}
- component: {fileID: 834739661}
m_Layer: 0
m_Name: LeftTarget
m_TagString: Untagged
......@@ -1186,6 +1235,17 @@ Transform:
m_Father: {fileID: 373884247}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &834739661
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 834739659}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 53f76b8adcf2348e3a73cf1343cb10e5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &900750523
GameObject:
m_ObjectHideFlags: 0
......@@ -1195,6 +1255,7 @@ GameObject:
m_Component:
- component: {fileID: 900750524}
- component: {fileID: 900750525}
- component: {fileID: 900750526}
m_Layer: 0
m_Name: MovingTarget
m_TagString: Untagged
......@@ -1230,6 +1291,17 @@ MonoBehaviour:
posChangeSpeed: 2
maxPos: 8
minPos: 6
--- !u!114 &900750526
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 900750523}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 53f76b8adcf2348e3a73cf1343cb10e5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &907546174
GameObject:
m_ObjectHideFlags: 0
......@@ -1240,8 +1312,8 @@ GameObject:
- component: {fileID: 907546179}
- component: {fileID: 907546178}
- component: {fileID: 907546177}
- component: {fileID: 907546176}
- component: {fileID: 907546175}
- component: {fileID: 907546176}
m_Layer: 0
m_Name: target
m_TagString: Untagged
......@@ -1367,6 +1439,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 911242811}
- component: {fileID: 911242812}
m_Layer: 0
m_Name: RightTarget
m_TagString: Untagged
......@@ -1390,6 +1463,17 @@ Transform:
m_Father: {fileID: 373884247}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &911242812
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 911242810}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 53f76b8adcf2348e3a73cf1343cb10e5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &937751195
GameObject:
m_ObjectHideFlags: 0
......@@ -1972,8 +2056,8 @@ GameObject:
m_Component:
- component: {fileID: 1342318062}
- component: {fileID: 1342318064}
- component: {fileID: 1342318063}
- component: {fileID: 1342318066}
- component: {fileID: 1342318063}
m_Layer: 0
m_Name: Bear-1
m_TagString: Untagged
......@@ -2230,6 +2314,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 1380510223}
- component: {fileID: 1380510224}
m_Layer: 0
m_Name: LeftTarget
m_TagString: Untagged
......@@ -2253,6 +2338,17 @@ Transform:
m_Father: {fileID: 1046844653}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1380510224
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1380510222}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 53f76b8adcf2348e3a73cf1343cb10e5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1393722531
GameObject:
m_ObjectHideFlags: 0
......@@ -2535,6 +2631,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 1565391572}
- component: {fileID: 1565391573}
m_Layer: 0
m_Name: RightTarget
m_TagString: Untagged
......@@ -2556,6 +2653,17 @@ Transform:
m_Father: {fileID: 1393722532}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1565391573
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1565391571}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 53f76b8adcf2348e3a73cf1343cb10e5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &1625387933
Prefab:
m_ObjectHideFlags: 0
......@@ -2882,8 +2990,8 @@ GameObject:
m_Component:
- component: {fileID: 1952118182}
- component: {fileID: 1952118185}
- component: {fileID: 1952118184}
- component: {fileID: 1952118183}
- component: {fileID: 1952118184}
m_Layer: 0
m_Name: mime-1
m_TagString: Untagged
......@@ -3122,8 +3230,8 @@ GameObject:
m_Component:
- component: {fileID: 1976184387}
- component: {fileID: 1976184390}
- component: {fileID: 1976184389}
- component: {fileID: 1976184388}
- component: {fileID: 1976184389}
m_Layer: 0
m_Name: mime-1
m_TagString: Untagged
......@@ -3539,6 +3647,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 2076957778}
- component: {fileID: 2076957779}
m_Layer: 0
m_Name: LeftTarget
m_TagString: Untagged
......@@ -3560,6 +3669,17 @@ Transform:
m_Father: {fileID: 1393722532}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2076957779
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2076957777}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 53f76b8adcf2348e3a73cf1343cb10e5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &2079469437
Prefab:
m_ObjectHideFlags: 0
......
......@@ -13,14 +13,12 @@ public class MovingTarget : MonoBehaviour {
previousPos = -9f;
if (gameObject.activeSelf){
PieTarget[] targets = gameObject.transform.parent.GetComponentsInChildren<PieTarget>();
print(targets.Length);
for (int i = 0; i < gameObject.transform.parent.childCount; i++)
{
if (!targets[i].GetComponent<MovingTarget>()){
targets[i].gameObject.SetActive(false);
}
}
}
gameObject.SetActive(true);
}
// Update is called once per frame
void Update()
......
......@@ -48,10 +48,10 @@ public class PieManager : MonoBehaviour {
do
{
n = Random.Range(0, 9);
} while (targets[n].transform.parent.gameObject.activeSelf == false);
targets[n].transform.parent.gameObject.SetActive(false);
} while (targets[n].gameObject.activeSelf == false);
targets[n].gameObject.SetActive(false);
}
targets[4].gameObject.SetActive(true);
//targets[0].gameObject.SetActive(false);
//gameObject.transform.GetComponent<MovingTarget>().gameObject.SetActive(true);
}
}
m_EditorVersion: 2018.2.11f1
m_EditorVersion: 2018.2.12f1
Supports Markdown
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