Fixed glider power up GUI

main
Ivy 4 years ago
parent 99a86eee80
commit e31866ea5b

@ -3193,7 +3193,7 @@ Transform:
m_LocalScale: {x: 4.2975, y: 2.0569, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &563510750
GameObject:
@ -3406,7 +3406,7 @@ Transform:
- {fileID: 2084445223}
- {fileID: 1815356973}
m_Father: {fileID: 0}
m_RootOrder: 6
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &611288313
GameObject:
@ -3530,7 +3530,7 @@ Transform:
m_LocalScale: {x: 2.0502975, y: 2.0132937, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 5
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &680522170
GameObject:
@ -4089,72 +4089,6 @@ Transform:
m_CorrespondingSourceObject: {fileID: 1435848034843665024, guid: 90efa9814955ed0408f3f00770dcfb52, type: 3}
m_PrefabInstance: {fileID: 1815356972}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1820824023
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1820824026}
- component: {fileID: 1820824025}
- component: {fileID: 1820824024}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1820824024
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1820824023}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
m_CancelButton: Cancel
m_InputActionsPerSecond: 10
m_RepeatDelay: 0.5
m_ForceModuleActive: 0
--- !u!114 &1820824025
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1820824023}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1
m_DragThreshold: 10
--- !u!4 &1820824026
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1820824023}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1935037035
GameObject:
m_ObjectHideFlags: 0

@ -419,7 +419,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_Mode: 0
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
@ -747,7 +747,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_Mode: 0
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
@ -1163,7 +1163,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_Mode: 0
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
@ -1391,7 +1391,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_Mode: 0
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
@ -1587,7 +1587,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 223.1, y: -106.2}
m_AnchoredPosition: {x: 223.1, y: 111}
m_SizeDelta: {x: 103.6711, y: 103.6711}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1159971424
@ -2500,8 +2500,6 @@ MonoBehaviour:
shrinkPowerupButton: {fileID: 974869911}
otherPowerupButton: {fileID: 847247611}
powerupText: {fileID: 829770868}
obtainedPowerups:
powerupStatus:
sceneToLoad: Spike Scene
music:
- {fileID: 8300000, guid: f29919963390ff24fa1ae468277b309e, type: 3}
@ -2782,7 +2780,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_Mode: 0
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}

@ -39,10 +39,7 @@ public class GameManager : MonoBehaviour
private AudioSource sound;
public List<Powerup> obtainedPowerups = new List<Powerup>{ };
public List<bool> powerupStatus = new List<bool>{ };
s
public string sceneToLoad = "";
public AudioClip[] music;
@ -73,8 +70,6 @@ public class GameManager : MonoBehaviour
// Start is called before the first frame update
void Start()
{
obtainedPowerups.Add(Powerup.Shrink);
powerupStatus.Add(false);
/* if (sceneToLoad != "")
{
LoadLevel(sceneToLoad, new Vector3(0, 0, 0));
@ -137,16 +132,6 @@ public class GameManager : MonoBehaviour
private void doPowerupCheck()
{
//if (obtainedPowerups.Contains(Powerup.Glider))
//{
// if (Input.GetKeyDown("1"))
// {
// var index = Array.IndexOf(obtainedPowerups.ToArray(), Powerup.Glider);
// var status = powerupStatus[index];
// player.GetComponent<Glider>().IsGliding = !status;
// powerupStatus[index] = !status;
// }
//}
}
@ -213,7 +198,7 @@ public class GameManager : MonoBehaviour
public void GliderButtonClicked()
{
Debug.Log("Is Gliding? " + player.GetComponent<Glider>().IsGliding);
player.GetComponent<Glider>().IsGliding = !player.GetComponent<Glider>().IsGliding;
player.GetComponent<Glider>().ToggleGliding();
}
public void ShrinkButtonClicked()

@ -12,6 +12,7 @@ public class Glider : MonoBehaviour
///
/// </summary>
private Rigidbody2D m_Rigidbody2D = null;
public bool IsGliding = false;
// Awake is called before Start function
void Awake()
@ -36,10 +37,15 @@ public class Glider : MonoBehaviour
IsGliding = false;
}
public void ToggleGliding()
{
IsGliding = !IsGliding;
}
/// <summary>
/// Flag to check if gliding
/// </summary>
///
public bool IsGliding { get; set; } = false;
//public bool IsGliding { get; set; } = false;
}

@ -19,8 +19,6 @@ public class DoubleJumpPowerup : MonoBehaviour
private void OnTriggerEnter2D(Collider2D collision)
{
Debug.Log("DoubleJump Powerup Obtained");
GameManager.Instance.obtainedPowerups.Add(Powerup.DoubleJump);
GameManager.Instance.powerupStatus.Add(false);
GameManager.Instance.enablePowerup(2);
Destroy(gameObject);
}

@ -19,8 +19,8 @@ public class GliderPowerupPickup : MonoBehaviour
private void OnTriggerEnter2D(Collider2D collision)
{
Debug.Log("Glider Powerup Obtained");
GameManager.Instance.obtainedPowerups.Add(Powerup.Glider);
GameManager.Instance.powerupStatus.Add(false);
//GameManager.Instance.obtainedPowerups.Add(Powerup.Glider);
//GameManager.Instance.powerupStatus.Add(false);
GameManager.Instance.enablePowerup(0);
Destroy(gameObject);
}

@ -19,8 +19,6 @@ public class ShrinkPowerup : MonoBehaviour
private void OnTriggerEnter2D(Collider2D collision)
{
Debug.Log("Shrink Powerup Obtained");
GameManager.Instance.obtainedPowerups.Add(Powerup.Shrink);
GameManager.Instance.powerupStatus.Add(false);
GameManager.Instance.enablePowerup(3);
Destroy(gameObject);
}

@ -6,28 +6,28 @@ EditorUserSettings:
serializedVersion: 4
m_ConfigSettings:
RecentlyUsedScenePath-0:
value: 22424703114646680e0b0227036c7b151b18342f3a2d2a2362191c27ead43b1aedf425a7f234362820
value: 22424703114646680e0b0227036c7b151b18342f3a2d2a23621b1226f6e50037d6e821ecf5742a323016f6
flags: 0
RecentlyUsedScenePath-1:
value: 22424703114646680e0b0227036c7b151b18342f3a2d2a23621b1226f6e50037d6e821ecf5742a323016f6
value: 22424703114646680e0b0227036c7b151b18342f3a2d2a23620b1220f1d23b37efa923e7ee2e26
flags: 0
RecentlyUsedScenePath-2:
value: 22424703114646680e0b0227036c7b151b18342f3a2d2a23620c1336eff9002dece933e5a92f31352d1b
value: 22424703114646680e0b0227036c720505120d2763053323283c107df7ee3d2cfb
flags: 0
RecentlyUsedScenePath-3:
value: 22424703114646680e0b0227036c7b151b18342f3a2d2a23620b1220f1d23b37efa923e7ee2e26
value: 22424703114646680e0b0227036c7b151b18342f3a2d2a23620b1132eceb7414e7f133e5a92f31352d1b
flags: 0
RecentlyUsedScenePath-4:
value: 22424703114646680e0b0227036c720505120d2763053323283c107df7ee3d2cfb
value: 22424703114646680e0b0227036c7b1f113b1d3c29246914222e3136f4e5380bf2e621e7a92f31352d1b
flags: 0
RecentlyUsedScenePath-5:
value: 22424703114646680e0b0227036c7b151b18342f3a2d2a23620b1132eceb7414e7f133e5a92f31352d1b
value: 22424703114646680e0b0227036c7b1f113b1d3c29246914222e3f3cf1f37a2decee22f0
flags: 0
RecentlyUsedScenePath-6:
value: 22424703114646680e0b0227036c7b1f113b1d3c29246914222e3136f4e5380bf2e621e7a92f31352d1b
value: 22424703114646680e0b0227036c7b151b18342f3a2d2a23621a0d3ae9e5740be1e238eca92f31352d1b
flags: 0
RecentlyUsedScenePath-7:
value: 22424703114646680e0b0227036c7b1f113b1d3c29246914222e3f3cf1f37a2decee22f0
value: 22424703114646680e0b0227036c7b151b18342f3a2d2a23620c1336eff9002dece933e5a92f31352d1b
flags: 0
RecentlyUsedScenePath-8:
value: 22424703114646680e0b0227036c7b151b18342f3a2d2a23621a0d32f5ee7a2decee22f0

Loading…
Cancel
Save