Commit 636d9743 authored by astatham's avatar astatham
Browse files

Started fixing moving target bug

parent 4266bfb2
<Properties StartupConfiguration="{67A4F128-F6AC-CD88-DA35-F29416A0792A}|">
<MonoDevelop.Ide.ItemProperties.Assembly-CSharp PreferredExecutionTarget="Unity.Editor" />
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/Scripts/LevelManager.cs">
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/Scripts/PieScripts/PieManager.cs">
<Files>
<File FileName="Assets/Scripts/SpawnKeys.cs" Line="98" Column="33" />
<File FileName="Assets/Scripts/DaytimeScripts/DaytimeManager.cs" Line="1" Column="1" />
<File FileName="Assets/Scripts/LevelManager.cs" Line="22" Column="9" />
<File FileName="Assets/Scripts/PieScripts/Pie.cs" Line="34" Column="19" />
<File FileName="Assets/Scripts/MenuScripts/PauseMenu.cs" Line="61" Column="5" />
<File FileName="Assets/Scripts/PieScripts/PowerBar.cs" Line="46" Column="22" />
<File FileName="Assets/Scripts/PieScripts/Needle.cs" Line="1" Column="1" />
<File FileName="Assets/Scripts/PieScripts/MovingTarget.cs" Line="1" Column="1" />
<File FileName="Assets/Scripts/PieScripts/PieTarget.cs" Line="1" Column="1" />
<File FileName="Assets/Scripts/PieScripts/PieManager.cs" Line="1" Column="1" />
</Files>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
......
......@@ -164,6 +164,16 @@ Prefab:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 212452611458889896, guid: b2f35ec24acb33f4eaa815ee25fe06ba,
type: 2}
propertyPath: m_SortingLayerID
value: -1106870113
objectReference: {fileID: 0}
- target: {fileID: 212452611458889896, guid: b2f35ec24acb33f4eaa815ee25fe06ba,
type: 2}
propertyPath: m_SortingLayer
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: b2f35ec24acb33f4eaa815ee25fe06ba, type: 2}
m_IsPrefabAsset: 0
......@@ -333,8 +343,60 @@ Transform:
m_LocalScale: {x: 2, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 5
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90}
--- !u!1001 &330818142
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 224962148856270744, guid: a6dd0ddad611645efbc5ef92c67041a7,
type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4682724213509072, guid: a6dd0ddad611645efbc5ef92c67041a7, type: 2}
propertyPath: m_LocalPosition.x
value: 1.0530677
objectReference: {fileID: 0}
- target: {fileID: 4682724213509072, guid: a6dd0ddad611645efbc5ef92c67041a7, type: 2}
propertyPath: m_LocalPosition.y
value: 1.222854
objectReference: {fileID: 0}
- target: {fileID: 4682724213509072, guid: a6dd0ddad611645efbc5ef92c67041a7, type: 2}
propertyPath: m_LocalPosition.z
value: -5.073231
objectReference: {fileID: 0}
- target: {fileID: 4682724213509072, guid: a6dd0ddad611645efbc5ef92c67041a7, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4682724213509072, guid: a6dd0ddad611645efbc5ef92c67041a7, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4682724213509072, guid: a6dd0ddad611645efbc5ef92c67041a7, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4682724213509072, guid: a6dd0ddad611645efbc5ef92c67041a7, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4682724213509072, guid: a6dd0ddad611645efbc5ef92c67041a7, type: 2}
propertyPath: m_RootOrder
value: 4
objectReference: {fileID: 0}
- target: {fileID: 114406577260795664, guid: a6dd0ddad611645efbc5ef92c67041a7,
type: 2}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: ExitGame
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: a6dd0ddad611645efbc5ef92c67041a7, type: 2}
m_IsPrefabAsset: 0
--- !u!1 &373884246
GameObject:
m_ObjectHideFlags: 0
......@@ -474,7 +536,7 @@ Transform:
- {fileID: 373884247}
- {fileID: 1393722532}
m_Father: {fileID: 0}
m_RootOrder: 8
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &488923751
GameObject:
......@@ -658,7 +720,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &537888089
GameObject:
......@@ -733,7 +795,7 @@ Transform:
m_LocalScale: {x: 3, y: 3, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 9
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &634434896
GameObject:
......@@ -762,7 +824,7 @@ Transform:
m_Children:
- {fileID: 1911354534}
m_Father: {fileID: 0}
m_RootOrder: 7
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &665801904
Prefab:
......@@ -938,8 +1000,8 @@ SpriteRenderer:
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingLayerID: -1966733235
m_SortingLayer: 2
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 15fe3851b7de048f4816224babe75f78, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
......@@ -1060,6 +1122,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 900750524}
- component: {fileID: 900750525}
m_Layer: 0
m_Name: MovingTarget
m_TagString: Untagged
......@@ -1074,13 +1137,27 @@ Transform:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 900750523}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.9671926, y: -0.12089479, z: 0}
m_LocalPosition: {x: 9, y: -4.45, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1342318062}
m_Father: {fileID: 1393722532}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &900750525
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: 1a8f5a68b95cfc0429f6f5a25d89152e, type: 3}
m_Name:
m_EditorClassIdentifier:
posChangeSpeed: 2
maxPos: 8
minPos: 6
--- !u!1 &907546174
GameObject:
m_ObjectHideFlags: 0
......@@ -1687,7 +1764,6 @@ GameObject:
- component: {fileID: 1342318062}
- component: {fileID: 1342318064}
- component: {fileID: 1342318063}
- component: {fileID: 1342318065}
- component: {fileID: 1342318066}
m_Layer: 0
m_Name: Bear-1
......@@ -1703,7 +1779,7 @@ Transform:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1342318061}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 10, y: -4.3, z: 0.046875}
m_LocalPosition: {x: 0, y: 0, z: 0.046875}
m_LocalScale: {x: -1.5, y: 1.5, z: 1}
m_Children: []
m_Father: {fileID: 900750524}
......@@ -1766,20 +1842,6 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!114 &1342318065
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1342318061}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1a8f5a68b95cfc0429f6f5a25d89152e, type: 3}
m_Name:
m_EditorClassIdentifier:
posChangeSpeed: 2
maxPos: 8
minPos: 6
--- !u!61 &1342318066
BoxCollider2D:
m_ObjectHideFlags: 0
......@@ -1789,7 +1851,7 @@ BoxCollider2D:
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0.14, y: -0.04}
......@@ -2157,7 +2219,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!4 &1565391572
Transform:
m_ObjectHideFlags: 0
......@@ -2702,7 +2764,7 @@ Transform:
m_LocalScale: {x: 3.59, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 6
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!61 &1956120125
BoxCollider2D:
......@@ -2828,8 +2890,8 @@ SpriteRenderer:
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingLayerID: -1966733235
m_SortingLayer: 2
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 5b1cdd571c6653d4d95e3e55c00f3601, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
......
......@@ -58,4 +58,5 @@ public class PauseMenu : MonoBehaviour {
Time.timeScale = 1;
SceneManager.LoadScene("MainMenu");
}
}
......@@ -11,6 +11,16 @@ public class MovingTarget : MonoBehaviour {
void Start()
{
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);
}
}
}
}
// Update is called once per frame
void Update()
......
......@@ -30,12 +30,7 @@ public class PieManager : MonoBehaviour {
} while (targets[n].transform.parent.gameObject.activeSelf == false);
targets[n].transform.parent.gameObject.SetActive(false);
}
targets[0].transform.parent.gameObject.SetActive(true);
if (targets[0].transform.gameObject.activeSelf == true)
{
targets[2].transform.parent.gameObject.SetActive(false);
targets[5].transform.parent.gameObject.SetActive(false);
targets[8].transform.parent.gameObject.SetActive(false);
}
targets[4].gameObject.SetActive(true);
//gameObject.transform.GetComponent<MovingTarget>().gameObject.SetActive(true);
}
}
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