diff --git a/MuseumGame/Assets/Scenes/Museum/Museum.unity b/MuseumGame/Assets/Scenes/Museum/Museum.unity index 0d3191c..b821b31 100644 --- a/MuseumGame/Assets/Scenes/Museum/Museum.unity +++ b/MuseumGame/Assets/Scenes/Museum/Museum.unity @@ -13532,7 +13532,7 @@ Transform: - {fileID: 993848333} - {fileID: 1620187171} m_Father: {fileID: 0} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &993848332 GameObject: @@ -13842,6 +13842,63 @@ Tilemap: e31: 0 e32: 0 e33: 1 +--- !u!1001 &1404422570 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 3406909610842081608, guid: 017d2509132c9428fbed8092b26dfaba, type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3406909610842081608, guid: 017d2509132c9428fbed8092b26dfaba, type: 3} + propertyPath: m_LocalPosition.x + value: 18.722578 + objectReference: {fileID: 0} + - target: {fileID: 3406909610842081608, guid: 017d2509132c9428fbed8092b26dfaba, type: 3} + propertyPath: m_LocalPosition.y + value: -2.2699764 + objectReference: {fileID: 0} + - target: {fileID: 3406909610842081608, guid: 017d2509132c9428fbed8092b26dfaba, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3406909610842081608, guid: 017d2509132c9428fbed8092b26dfaba, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3406909610842081608, guid: 017d2509132c9428fbed8092b26dfaba, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3406909610842081608, guid: 017d2509132c9428fbed8092b26dfaba, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3406909610842081608, guid: 017d2509132c9428fbed8092b26dfaba, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3406909610842081608, guid: 017d2509132c9428fbed8092b26dfaba, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3406909610842081608, guid: 017d2509132c9428fbed8092b26dfaba, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3406909610842081608, guid: 017d2509132c9428fbed8092b26dfaba, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3406909610842081614, guid: 017d2509132c9428fbed8092b26dfaba, type: 3} + propertyPath: m_Name + value: Glider Powerup placeholder + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 017d2509132c9428fbed8092b26dfaba, type: 3} --- !u!1 &1620187170 GameObject: m_ObjectHideFlags: 0 diff --git a/MuseumGame/Assets/Scripts/Glider.cs b/MuseumGame/Assets/Scripts/Glider.cs index 461af23..4f5655d 100644 --- a/MuseumGame/Assets/Scripts/Glider.cs +++ b/MuseumGame/Assets/Scripts/Glider.cs @@ -8,7 +8,6 @@ public class Glider : MonoBehaviour [SerializeField] private float m_FallSpeed = 0f; - private Animator animator; /// /// @@ -20,7 +19,6 @@ public class Glider : MonoBehaviour void Awake() { m_Rigidbody2D = GetComponent(); - animator = GetComponent(); } // Update is called once per frame @@ -29,11 +27,6 @@ public class Glider : MonoBehaviour if (IsGliding && m_Rigidbody2D.velocity.y < 0f && Mathf.Abs(m_Rigidbody2D.velocity.y) > m_FallSpeed) { m_Rigidbody2D.velocity = new Vector2(m_Rigidbody2D.velocity.x, Mathf.Sign(m_Rigidbody2D.velocity.y) * m_FallSpeed); - animator.SetBool("isGliding", true); - } - else - { - animator.SetBool("isGliding", false); } } diff --git a/MuseumGame/Assets/Scripts/movement.cs b/MuseumGame/Assets/Scripts/movement.cs index 473b3b9..3eaaa53 100644 --- a/MuseumGame/Assets/Scripts/movement.cs +++ b/MuseumGame/Assets/Scripts/movement.cs @@ -21,6 +21,8 @@ public class movement : MonoBehaviour private int numJumps; private bool isGrounded = true; + private Glider glider; + public AudioClip[] clips; private AudioSource a; @@ -31,18 +33,21 @@ public class movement : MonoBehaviour numJumps = maxJumps; animator = GetComponent(); a = GetComponent(); + glider = GetComponent(); } // Update is called once per frame void Update() - { + { + Debug.Log("glider.IsGliding" + glider.IsGliding); + animator.SetBool("isGliding", glider.IsGliding); if (Input.GetKeyDown("space") && numJumps > 0 && !GameManager.Instance.isPaused()) { rb2d.velocity = new Vector2(rb2d.velocity.x, 0); rb2d.AddForce(new Vector2(0, jumpForce)); isGrounded = false; - numJumps -= 1; + numJumps -= 1; } }