This commit is contained in:
Patrice Vignola 2015-08-23 13:11:47 -04:00
commit e7671d3014
11 changed files with 277 additions and 30 deletions

View File

@ -68,6 +68,23 @@ GameObject:
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 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 --- !u!1 &162968
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -113,10 +130,11 @@ Transform:
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 117128} m_GameObject: {fileID: 117128}
m_LocalRotation: {x: 0, y: -.707106829, z: 0, w: .707106709} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -.750999987, y: 0, z: 2.46000004} m_LocalPosition: {x: 1.42999995, y: 0, z: -.763999999}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: m_Children:
- {fileID: 465276}
- {fileID: 435764} - {fileID: 435764}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
@ -134,6 +152,18 @@ Transform:
- {fileID: 411502} - {fileID: 411502}
- {fileID: 482978} - {fileID: 482978}
m_Father: {fileID: 420558} 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 m_RootOrder: 0
--- !u!4 &482978 --- !u!4 &482978
Transform: Transform:
@ -267,6 +297,43 @@ MonoBehaviour:
MaxSpawnDelay: 15 MaxSpawnDelay: 15
PillowObject: {fileID: 11461144, guid: a576af077db55e24b82098add55cc9dc, type: 2} PillowObject: {fileID: 11461144, guid: a576af077db55e24b82098add55cc9dc, type: 2}
RelativePosition: {x: 1.60000002, y: .5, z: 0} 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 --- !u!1001 &100100000
Prefab: Prefab:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
@ -279,6 +346,23 @@ Prefab:
value: value:
objectReference: {fileID: 11461144, guid: a576af077db55e24b82098add55cc9dc, objectReference: {fileID: 11461144, guid: a576af077db55e24b82098add55cc9dc,
type: 2} 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_RemovedComponents: []
m_ParentPrefab: {fileID: 0} m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 117128} m_RootGameObject: {fileID: 117128}

View File

@ -19,6 +19,23 @@ GameObject:
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 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 --- !u!1 &129522
GameObject: GameObject:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
@ -142,9 +159,22 @@ Transform:
m_LocalPosition: {x: -2.79999995, y: 1.22300005, z: -1.41900003} m_LocalPosition: {x: -2.79999995, y: 1.22300005, z: -1.41900003}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: m_Children:
- {fileID: 424988}
- {fileID: 425006} - {fileID: 425006}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 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 --- !u!4 &425006
Transform: Transform:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
@ -161,7 +191,7 @@ Transform:
- {fileID: 498570} - {fileID: 498570}
- {fileID: 464110} - {fileID: 464110}
m_Father: {fileID: 420558} m_Father: {fileID: 420558}
m_RootOrder: 0 m_RootOrder: 1
--- !u!4 &446668 --- !u!4 &446668
Transform: Transform:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
@ -433,6 +463,43 @@ MonoBehaviour:
MaxSpawnDelay: 15 MaxSpawnDelay: 15
PillowObject: {fileID: 11461144, guid: a576af077db55e24b82098add55cc9dc, type: 2} PillowObject: {fileID: 11461144, guid: a576af077db55e24b82098add55cc9dc, type: 2}
RelativePosition: {x: 1.60000002, y: .5, z: 0} 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 --- !u!1001 &100100000
Prefab: Prefab:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1

View File

@ -16,6 +16,8 @@ public class Bed : MonoBehaviour
private float _nextSpawnDelay; private float _nextSpawnDelay;
private GameObject _actionButtonUI;
public bool IsTaken public bool IsTaken
{ {
get { return _isTaken; } get { return _isTaken; }
@ -26,6 +28,8 @@ public class Bed : MonoBehaviour
SpawnPillow(); SpawnPillow();
_nextSpawnDelay = GetNextSpawnDelay(); _nextSpawnDelay = GetNextSpawnDelay();
_actionButtonUI = transform.GetChild(0).gameObject;
} }
void Update() void Update()
@ -46,6 +50,7 @@ public class Bed : MonoBehaviour
_currentPillow = null; _currentPillow = null;
_elapsedTime = 0f; _elapsedTime = 0f;
} }
} }
private void SpawnPillow() private void SpawnPillow()
@ -103,21 +108,35 @@ public class Bed : MonoBehaviour
_currentPillow = col.gameObject.GetComponent<Pillow>(); _currentPillow = col.gameObject.GetComponent<Pillow>();
} }
} }
*/
void OnCollisionExit(Collision col) 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) void OnCollisionStay(Collision col)
{ {
if (col.gameObject.tag == "Player") if (col.gameObject.tag == "Player")
{ {
if (GameManager.Instance.GetMomState() == MomBehavior.State.Warning && col.gameObject.GetComponent<Child>().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);
}
}
} }
}*/ }
} }

View File

@ -179,7 +179,7 @@ public class Child : MonoBehaviour
_currentBed = null; _currentBed = null;
} }
private Bed GetBed() public Bed GetBed()
{ {
Collider[] colliders = Physics.OverlapSphere(GroundCheck.transform.position, 0.149f, 1 << LayerMask.NameToLayer("Bed")); Collider[] colliders = Physics.OverlapSphere(GroundCheck.transform.position, 0.149f, 1 << LayerMask.NameToLayer("Bed"));

View File

@ -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 () {
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 4df912412a9c22240826d5d757414a15
timeCreated: 1440341396
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -7,6 +7,7 @@ public class GameManager : MonoBehaviour
{ {
public int PlayerCount = 4; public int PlayerCount = 4;
private static GameManager _instance; private static GameManager _instance;
public MomBehavior mom;
public static GameManager Instance public static GameManager Instance
{ {
@ -70,4 +71,8 @@ public class GameManager : MonoBehaviour
MenusManager.Instance.SetInputValues(accept, false, 0f, yAxis); MenusManager.Instance.SetInputValues(accept, false, 0f, yAxis);
} }
public MomBehavior.State GetMomState() {
return mom.GetState();
}
} }

View File

@ -20,7 +20,7 @@ public class MomBehavior : MonoBehaviour
public Child[] Children; public Child[] Children;
private enum State { Away, Warning, InRoom } public enum State { Away, Warning, InRoom }
private State _currentState; private State _currentState;
@ -104,6 +104,10 @@ public class MomBehavior : MonoBehaviour
_currentState = newState; _currentState = newState;
} }
public State GetState(){
return _currentState;
}
private void CheckIfSleeping() private void CheckIfSleeping()
{ {
List<Child> safeChildren = new List<Child>(); List<Child> safeChildren = new List<Child>();

BIN
Assets/Sprites/360_X.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -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:

View File

@ -144,21 +144,4 @@ QualitySettings:
maximumLODLevel: 0 maximumLODLevel: 0
particleRaycastBudget: 4096 particleRaycastBudget: 4096
excludedTargetPlatforms: [] excludedTargetPlatforms: []
m_PerPlatformDefaultQuality: 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