diff --git a/Assets/Prefabs/Bed.prefab b/Assets/Prefabs/Bed.prefab index f6c9555..3f68d99 100644 --- a/Assets/Prefabs/Bed.prefab +++ b/Assets/Prefabs/Bed.prefab @@ -68,6 +68,23 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &153326 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 465276} + - 212: {fileID: 21299178} + - 114: {fileID: 11438362} + m_Layer: 0 + m_Name: XtoSleep + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 --- !u!1 &162968 GameObject: m_ObjectHideFlags: 0 @@ -113,10 +130,11 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 117128} - m_LocalRotation: {x: 0, y: -.707106829, z: 0, w: .707106709} - m_LocalPosition: {x: -.750999987, y: 0, z: 2.46000004} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.42999995, y: 0, z: -.763999999} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: + - {fileID: 465276} - {fileID: 435764} m_Father: {fileID: 0} m_RootOrder: 0 @@ -134,6 +152,18 @@ Transform: - {fileID: 411502} - {fileID: 482978} m_Father: {fileID: 420558} + m_RootOrder: 1 +--- !u!4 &465276 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 153326} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: .529999971, y: 1.83000004, z: 0} + m_LocalScale: {x: .5, y: .5, z: .5} + m_Children: [] + m_Father: {fileID: 420558} m_RootOrder: 0 --- !u!4 &482978 Transform: @@ -267,6 +297,43 @@ MonoBehaviour: MaxSpawnDelay: 15 PillowObject: {fileID: 11461144, guid: a576af077db55e24b82098add55cc9dc, type: 2} RelativePosition: {x: 1.60000002, y: .5, z: 0} +--- !u!114 &11438362 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 153326} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4df912412a9c22240826d5d757414a15, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &21299178 +SpriteRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 153326} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000e000000000000000, type: 0} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_UseLightProbes: 0 + m_ReflectionProbeUsage: 0 + m_ProbeAnchor: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_ImportantGI: 0 + m_AutoUVMaxDistance: .5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 10 + m_Sprite: {fileID: 21300000, guid: a3560cfab1ed517429ae69fed820e26e, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} --- !u!1001 &100100000 Prefab: m_ObjectHideFlags: 1 @@ -279,6 +346,23 @@ Prefab: value: objectReference: {fileID: 11461144, guid: a576af077db55e24b82098add55cc9dc, type: 2} + - target: {fileID: 0} + propertyPath: m_Sprite + value: + objectReference: {fileID: 21300000, guid: a3560cfab1ed517429ae69fed820e26e, + type: 3} + - target: {fileID: 0} + propertyPath: m_LocalPosition.x + value: .529999971 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: m_LocalPosition.y + value: 1.83000004 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: m_SortingOrder + value: 10 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 0} m_RootGameObject: {fileID: 117128} diff --git a/Assets/Prefabs/BunkBed.prefab b/Assets/Prefabs/BunkBed.prefab index 2a734c3..0109ac8 100644 --- a/Assets/Prefabs/BunkBed.prefab +++ b/Assets/Prefabs/BunkBed.prefab @@ -19,6 +19,23 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &117194 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 424988} + - 212: {fileID: 21235850} + - 114: {fileID: 11439634} + m_Layer: 0 + m_Name: XtoSleep + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 --- !u!1 &129522 GameObject: m_ObjectHideFlags: 1 @@ -142,9 +159,22 @@ Transform: m_LocalPosition: {x: -2.79999995, y: 1.22300005, z: -1.41900003} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: + - {fileID: 424988} - {fileID: 425006} m_Father: {fileID: 0} m_RootOrder: 0 +--- !u!4 &424988 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 117194} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: .850000024, y: 1.10000002, z: 0} + m_LocalScale: {x: .50000006, y: .5, z: .50000006} + m_Children: [] + m_Father: {fileID: 420558} + m_RootOrder: 0 --- !u!4 &425006 Transform: m_ObjectHideFlags: 1 @@ -161,7 +191,7 @@ Transform: - {fileID: 498570} - {fileID: 464110} m_Father: {fileID: 420558} - m_RootOrder: 0 + m_RootOrder: 1 --- !u!4 &446668 Transform: m_ObjectHideFlags: 1 @@ -433,6 +463,43 @@ MonoBehaviour: MaxSpawnDelay: 15 PillowObject: {fileID: 11461144, guid: a576af077db55e24b82098add55cc9dc, type: 2} RelativePosition: {x: 1.60000002, y: .5, z: 0} +--- !u!114 &11439634 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 117194} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4df912412a9c22240826d5d757414a15, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &21235850 +SpriteRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 117194} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000e000000000000000, type: 0} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_UseLightProbes: 0 + m_ReflectionProbeUsage: 0 + m_ProbeAnchor: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_ImportantGI: 0 + m_AutoUVMaxDistance: .5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: a3560cfab1ed517429ae69fed820e26e, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} --- !u!1001 &100100000 Prefab: m_ObjectHideFlags: 1 diff --git a/Assets/Scripts/Bed.cs b/Assets/Scripts/Bed.cs index fb4e896..9802b3b 100644 --- a/Assets/Scripts/Bed.cs +++ b/Assets/Scripts/Bed.cs @@ -16,6 +16,8 @@ public class Bed : MonoBehaviour private float _nextSpawnDelay; + private GameObject _actionButtonUI; + public bool IsTaken { get { return _isTaken; } @@ -26,6 +28,8 @@ public class Bed : MonoBehaviour SpawnPillow(); _nextSpawnDelay = GetNextSpawnDelay(); + + _actionButtonUI = transform.GetChild(0).gameObject; } void Update() @@ -46,6 +50,7 @@ public class Bed : MonoBehaviour _currentPillow = null; _elapsedTime = 0f; } + } private void SpawnPillow() @@ -103,21 +108,35 @@ public class Bed : MonoBehaviour _currentPillow = col.gameObject.GetComponent(); } } + */ void OnCollisionExit(Collision col) { - if (_currentPillow != null && col.gameObject == _currentPillow.gameObject) - { - _currentPillow = null; - } - }*/ - /* + if (col.gameObject.tag == "Player") + { + _actionButtonUI.SetActive(false); + } + } + + void OnCollisionStay(Collision col) { if (col.gameObject.tag == "Player") { + if (GameManager.Instance.GetMomState() == MomBehavior.State.Warning && col.gameObject.GetComponent().GetBed() ) { + // show the button for sleeping when is on her way to the room + if (!_actionButtonUI.activeSelf) { + _actionButtonUI.SetActive(true); + } + } + else { + if (_actionButtonUI.activeSelf) { + _actionButtonUI.SetActive(false); + } + } + } - }*/ + } } diff --git a/Assets/Scripts/Child.cs b/Assets/Scripts/Child.cs index d458d8b..dd1d4a9 100644 --- a/Assets/Scripts/Child.cs +++ b/Assets/Scripts/Child.cs @@ -179,7 +179,7 @@ public class Child : MonoBehaviour _currentBed = null; } - private Bed GetBed() + public Bed GetBed() { Collider[] colliders = Physics.OverlapSphere(GroundCheck.transform.position, 0.149f, 1 << LayerMask.NameToLayer("Bed")); diff --git a/Assets/Scripts/FaceCamera.cs b/Assets/Scripts/FaceCamera.cs new file mode 100644 index 0000000..0e0e944 --- /dev/null +++ b/Assets/Scripts/FaceCamera.cs @@ -0,0 +1,18 @@ +using UnityEngine; +using System.Collections; + +public class FaceCamera : MonoBehaviour { + Transform mainCamera; + + + // Use this for initialization + void Start () { + mainCamera = GameObject.FindGameObjectWithTag("MainCamera").transform; + transform.rotation = mainCamera.rotation; + } + + // Update is called once per frame + void Update () { + + } +} diff --git a/Assets/Scripts/FaceCamera.cs.meta b/Assets/Scripts/FaceCamera.cs.meta new file mode 100644 index 0000000..b388be5 --- /dev/null +++ b/Assets/Scripts/FaceCamera.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 4df912412a9c22240826d5d757414a15 +timeCreated: 1440341396 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index f2571e3..26a1698 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -7,6 +7,7 @@ public class GameManager : MonoBehaviour { public int PlayerCount = 4; private static GameManager _instance; + public MomBehavior mom; public static GameManager Instance { @@ -70,4 +71,8 @@ public class GameManager : MonoBehaviour MenusManager.Instance.SetInputValues(accept, false, 0f, yAxis); } + + public MomBehavior.State GetMomState() { + return mom.GetState(); + } } diff --git a/Assets/Scripts/MomBehavior.cs b/Assets/Scripts/MomBehavior.cs index c674abd..2f045e7 100644 --- a/Assets/Scripts/MomBehavior.cs +++ b/Assets/Scripts/MomBehavior.cs @@ -20,7 +20,7 @@ public class MomBehavior : MonoBehaviour public Child[] Children; - private enum State { Away, Warning, InRoom } + public enum State { Away, Warning, InRoom } private State _currentState; @@ -104,6 +104,10 @@ public class MomBehavior : MonoBehaviour _currentState = newState; } + public State GetState(){ + return _currentState; + } + private void CheckIfSleeping() { List safeChildren = new List(); diff --git a/Assets/Sprites/360_X.png b/Assets/Sprites/360_X.png new file mode 100644 index 0000000..4b8cec1 Binary files /dev/null and b/Assets/Sprites/360_X.png differ diff --git a/Assets/Sprites/360_X.png.meta b/Assets/Sprites/360_X.png.meta new file mode 100644 index 0000000..671c1d7 --- /dev/null +++ b/Assets/Sprites/360_X.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: a3560cfab1ed517429ae69fed820e26e +timeCreated: 1440342225 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/ProjectSettings/QualitySettings.asset b/ProjectSettings/QualitySettings.asset index 60b0053..856ed7a 100644 --- a/ProjectSettings/QualitySettings.asset +++ b/ProjectSettings/QualitySettings.asset @@ -144,21 +144,4 @@ QualitySettings: maximumLODLevel: 0 particleRaycastBudget: 4096 excludedTargetPlatforms: [] - m_PerPlatformDefaultQuality: - Android: 2 - BlackBerry: 2 - GLES Emulation: 5 - PS3: 5 - PS4: 5 - PSM: 5 - PSP2: 5 - Samsung TV: 2 - Standalone: 5 - Tizen: 2 - WP8: 5 - Web: 5 - WebGL: 3 - Windows Store Apps: 5 - XBOX360: 5 - XboxOne: 5 - iPhone: 2 + m_PerPlatformDefaultQuality: {}