diff --git a/Assets/ControllerMapper.asset b/Assets/ControllerMapper.asset index 3c8be40..53b355f 100644 Binary files a/Assets/ControllerMapper.asset and b/Assets/ControllerMapper.asset differ diff --git a/Assets/Scenes/PatScene.unity b/Assets/Scenes/PatScene.unity index 027082a..4e8c631 100644 Binary files a/Assets/Scenes/PatScene.unity and b/Assets/Scenes/PatScene.unity differ diff --git a/Assets/Scripts/Child.cs b/Assets/Scripts/Child.cs index 5846c8a..15c4a9b 100644 --- a/Assets/Scripts/Child.cs +++ b/Assets/Scripts/Child.cs @@ -62,7 +62,9 @@ public class Child : MonoBehaviour private bool IsGrounded() { - Collider[] colliders = Physics.OverlapSphere(GroundCheck.transform.position, 0.149f, 1 << LayerMask.NameToLayer("Ground")); + int mask = (1 << LayerMask.NameToLayer("Ground")) | (1 << LayerMask.NameToLayer("Bed")); + + Collider[] colliders = Physics.OverlapSphere(GroundCheck.transform.position, 0.149f, mask); return colliders.Length > 0; } @@ -87,12 +89,21 @@ public class Child : MonoBehaviour { _isSleeping = IsOnBed(); + // Temporary (only for visual cue until we get the animation) + if (_isSleeping) + { + transform.localEulerAngles = new Vector3(90f, transform.localEulerAngles.y, transform.localEulerAngles.z); + } + return _isSleeping; } public void WakeUp() { _isSleeping = false; + + // Temporary (only for visual cue until we get the animation) + transform.localEulerAngles = new Vector3(0f, transform.localEulerAngles.y, transform.localEulerAngles.z); } private bool IsOnBed() diff --git a/Assets/Scripts/ChildController.cs b/Assets/Scripts/ChildController.cs index 70c6ede..647b000 100644 --- a/Assets/Scripts/ChildController.cs +++ b/Assets/Scripts/ChildController.cs @@ -60,10 +60,12 @@ public class ChildController : MonoBehaviour if (input.Actions.Contains("Sleep") && _child.Sleep()) { + Debug.Log("SLEEPING"); InputManager.Instance.PushActiveContext("Sleeping", (int)PlayerNumber); } else if (input.Actions.Contains("WakeUp")) { + Debug.Log("AWAKE"); _child.WakeUp(); InputManager.Instance.PushActiveContext("Awake", (int)PlayerNumber); } diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index a8d546d..0875a70 100644 Binary files a/ProjectSettings/TagManager.asset and b/ProjectSettings/TagManager.asset differ