game: shifts added
not set to 10minutes yet
This commit is contained in:
parent
e50e526ddb
commit
30b88c4da4
3 changed files with 188 additions and 15 deletions
|
@ -737,7 +737,8 @@ Transform:
|
||||||
m_LocalPosition: {x: -0.011000037, y: 0.43819124, z: 1.38}
|
m_LocalPosition: {x: -0.011000037, y: 0.43819124, z: 1.38}
|
||||||
m_LocalScale: {x: 2.6065, y: 0.87638336, z: 0.59199}
|
m_LocalScale: {x: 2.6065, y: 0.87638336, z: 0.59199}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children:
|
||||||
|
- {fileID: 1938714097}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!1001 &441087506
|
--- !u!1001 &441087506
|
||||||
|
@ -778,7 +779,7 @@ PrefabInstance:
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 1717954561962503726, guid: f6336ac4ac8b4d34bc5072418cdc62a0, type: 3}
|
- target: {fileID: 1717954561962503726, guid: f6336ac4ac8b4d34bc5072418cdc62a0, type: 3}
|
||||||
propertyPath: m_LocalPosition.x
|
propertyPath: m_LocalPosition.x
|
||||||
value: 0
|
value: -5.51
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 1717954561962503726, guid: f6336ac4ac8b4d34bc5072418cdc62a0, type: 3}
|
- target: {fileID: 1717954561962503726, guid: f6336ac4ac8b4d34bc5072418cdc62a0, type: 3}
|
||||||
propertyPath: m_LocalPosition.y
|
propertyPath: m_LocalPosition.y
|
||||||
|
@ -790,19 +791,19 @@ PrefabInstance:
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 1717954561962503726, guid: f6336ac4ac8b4d34bc5072418cdc62a0, type: 3}
|
- target: {fileID: 1717954561962503726, guid: f6336ac4ac8b4d34bc5072418cdc62a0, type: 3}
|
||||||
propertyPath: m_LocalRotation.w
|
propertyPath: m_LocalRotation.w
|
||||||
value: 1
|
value: 0.70710653
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 1717954561962503726, guid: f6336ac4ac8b4d34bc5072418cdc62a0, type: 3}
|
- target: {fileID: 1717954561962503726, guid: f6336ac4ac8b4d34bc5072418cdc62a0, type: 3}
|
||||||
propertyPath: m_LocalRotation.x
|
propertyPath: m_LocalRotation.x
|
||||||
value: 0
|
value: -0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 1717954561962503726, guid: f6336ac4ac8b4d34bc5072418cdc62a0, type: 3}
|
- target: {fileID: 1717954561962503726, guid: f6336ac4ac8b4d34bc5072418cdc62a0, type: 3}
|
||||||
propertyPath: m_LocalRotation.y
|
propertyPath: m_LocalRotation.y
|
||||||
value: 0
|
value: 0.70710707
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 1717954561962503726, guid: f6336ac4ac8b4d34bc5072418cdc62a0, type: 3}
|
- target: {fileID: 1717954561962503726, guid: f6336ac4ac8b4d34bc5072418cdc62a0, type: 3}
|
||||||
propertyPath: m_LocalRotation.z
|
propertyPath: m_LocalRotation.z
|
||||||
value: 0
|
value: -0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 1717954561962503726, guid: f6336ac4ac8b4d34bc5072418cdc62a0, type: 3}
|
- target: {fileID: 1717954561962503726, guid: f6336ac4ac8b4d34bc5072418cdc62a0, type: 3}
|
||||||
propertyPath: m_LocalEulerAnglesHint.x
|
propertyPath: m_LocalEulerAnglesHint.x
|
||||||
|
@ -810,7 +811,7 @@ PrefabInstance:
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 1717954561962503726, guid: f6336ac4ac8b4d34bc5072418cdc62a0, type: 3}
|
- target: {fileID: 1717954561962503726, guid: f6336ac4ac8b4d34bc5072418cdc62a0, type: 3}
|
||||||
propertyPath: m_LocalEulerAnglesHint.y
|
propertyPath: m_LocalEulerAnglesHint.y
|
||||||
value: 0
|
value: 90
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 1717954561962503726, guid: f6336ac4ac8b4d34bc5072418cdc62a0, type: 3}
|
- target: {fileID: 1717954561962503726, guid: f6336ac4ac8b4d34bc5072418cdc62a0, type: 3}
|
||||||
propertyPath: m_LocalEulerAnglesHint.z
|
propertyPath: m_LocalEulerAnglesHint.z
|
||||||
|
@ -823,6 +824,9 @@ PrefabInstance:
|
||||||
- targetCorrespondingSourceObject: {fileID: 1717954561962503725, guid: f6336ac4ac8b4d34bc5072418cdc62a0, type: 3}
|
- targetCorrespondingSourceObject: {fileID: 1717954561962503725, guid: f6336ac4ac8b4d34bc5072418cdc62a0, type: 3}
|
||||||
insertIndex: -1
|
insertIndex: -1
|
||||||
addedObject: {fileID: 456355250}
|
addedObject: {fileID: 456355250}
|
||||||
|
- targetCorrespondingSourceObject: {fileID: 1717954561962503725, guid: f6336ac4ac8b4d34bc5072418cdc62a0, type: 3}
|
||||||
|
insertIndex: -1
|
||||||
|
addedObject: {fileID: 456355257}
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: f6336ac4ac8b4d34bc5072418cdc62a0, type: 3}
|
m_SourcePrefab: {fileID: 100100000, guid: f6336ac4ac8b4d34bc5072418cdc62a0, type: 3}
|
||||||
--- !u!1 &456355243 stripped
|
--- !u!1 &456355243 stripped
|
||||||
GameObject:
|
GameObject:
|
||||||
|
@ -841,6 +845,33 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: 453d520beb5656b4b8f3e696d9a97205, type: 3}
|
m_Script: {fileID: 11500000, guid: 453d520beb5656b4b8f3e696d9a97205, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
--- !u!54 &456355257
|
||||||
|
Rigidbody:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 456355243}
|
||||||
|
serializedVersion: 4
|
||||||
|
m_Mass: 1
|
||||||
|
m_Drag: 0
|
||||||
|
m_AngularDrag: 0.05
|
||||||
|
m_CenterOfMass: {x: 0, y: 0, z: 0}
|
||||||
|
m_InertiaTensor: {x: 1, y: 1, z: 1}
|
||||||
|
m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_IncludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_ExcludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_ImplicitCom: 1
|
||||||
|
m_ImplicitTensor: 1
|
||||||
|
m_UseGravity: 0
|
||||||
|
m_IsKinematic: 1
|
||||||
|
m_Interpolate: 0
|
||||||
|
m_Constraints: 0
|
||||||
|
m_CollisionDetection: 0
|
||||||
--- !u!1 &520849214
|
--- !u!1 &520849214
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -1279,6 +1310,73 @@ CanvasRenderer:
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 726703121}
|
m_GameObject: {fileID: 726703121}
|
||||||
m_CullTransparentMesh: 1
|
m_CullTransparentMesh: 1
|
||||||
|
--- !u!1 &732601457
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 732601459}
|
||||||
|
- component: {fileID: 732601458}
|
||||||
|
- component: {fileID: 732601460}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: StartShift
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!65 &732601458
|
||||||
|
BoxCollider:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 732601457}
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_IncludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_ExcludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_LayerOverridePriority: 0
|
||||||
|
m_IsTrigger: 1
|
||||||
|
m_ProvidesContacts: 0
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 3
|
||||||
|
m_Size: {x: 2.3502903, y: 2.1451125, z: 1.221778}
|
||||||
|
m_Center: {x: -0.013496637, y: 0.57255626, z: -0.11088902}
|
||||||
|
--- !u!4 &732601459
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 732601457}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: -0.008, y: 0.513, z: 0.48}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &732601460
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 732601457}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 0bab791ccf13189449b82b8f0b70b269, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
shiftDuration: 5
|
||||||
--- !u!1 &756192406
|
--- !u!1 &756192406
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -2127,7 +2225,7 @@ GameObject:
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 0
|
m_IsActive: 1
|
||||||
--- !u!65 &1298003771
|
--- !u!65 &1298003771
|
||||||
BoxCollider:
|
BoxCollider:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -2589,7 +2687,7 @@ Transform:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 0.739, y: 1.2288415, z: 1.281}
|
m_LocalPosition: {x: 0.739, y: 1.2288415, z: 1.281}
|
||||||
m_LocalScale: {x: 0.47472, y: 0.47472, z: 0.47472}
|
m_LocalScale: {x: 0.20617564, y: 0.20617564, z: 0.20617564}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 2030042389}
|
- {fileID: 2030042389}
|
||||||
|
@ -2773,12 +2871,12 @@ Transform:
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1938714094}
|
m_GameObject: {fileID: 1938714094}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: 0, y: 0.9904229, z: 0, w: 0.13806683}
|
m_LocalRotation: {x: -0, y: 0.9904229, z: -0, w: 0.13806683}
|
||||||
m_LocalPosition: {x: -0.645, y: 0.893, z: 1.389}
|
m_LocalPosition: {x: -0.24323805, y: 0.51896095, z: 0.015203065}
|
||||||
m_LocalScale: {x: 0.45395544, y: 0.014691553, z: 0.57689166}
|
m_LocalScale: {x: 0.18484867, y: 0.016763842, z: 0.77678293}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 418120326}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 164.128, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 164.128, z: 0}
|
||||||
--- !u!114 &1938714098
|
--- !u!114 &1938714098
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
@ -3108,7 +3206,7 @@ Transform:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: -0.779, y: 1.2288415, z: 1.281}
|
m_LocalPosition: {x: -0.779, y: 1.2288415, z: 1.281}
|
||||||
m_LocalScale: {x: 0.47472, y: 0.47472, z: 0.47472}
|
m_LocalScale: {x: 0.20617564, y: 0.20617564, z: 0.20617564}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 1535873645}
|
- {fileID: 1535873645}
|
||||||
|
@ -3253,4 +3351,4 @@ SceneRoots:
|
||||||
- {fileID: 418120326}
|
- {fileID: 418120326}
|
||||||
- {fileID: 2043314906}
|
- {fileID: 2043314906}
|
||||||
- {fileID: 1627151202}
|
- {fileID: 1627151202}
|
||||||
- {fileID: 1938714097}
|
- {fileID: 732601459}
|
||||||
|
|
64
SSLR/Assets/Scripts/ShiftManager.cs
Normal file
64
SSLR/Assets/Scripts/ShiftManager.cs
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
/*
|
||||||
|
* Author: Livinia Poo
|
||||||
|
* Date: 4/2/25
|
||||||
|
* Description:
|
||||||
|
* Starting/Ending Shifts
|
||||||
|
*/
|
||||||
|
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class ShiftManager : MonoBehaviour
|
||||||
|
{
|
||||||
|
private bool shiftStarted;
|
||||||
|
[SerializeField]
|
||||||
|
private float shiftDuration;
|
||||||
|
private float remainingTime;
|
||||||
|
|
||||||
|
private Collider shiftTrigger;
|
||||||
|
|
||||||
|
void Awake()
|
||||||
|
{
|
||||||
|
shiftStarted = false;
|
||||||
|
remainingTime = shiftDuration;
|
||||||
|
|
||||||
|
shiftTrigger = GetComponent<Collider>();
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnTriggerEnter(Collider other)
|
||||||
|
{
|
||||||
|
if (other.tag == "Player" && !shiftStarted)
|
||||||
|
{
|
||||||
|
Debug.Log("Shift started");
|
||||||
|
|
||||||
|
shiftStarted = true;
|
||||||
|
shiftTrigger.enabled = false;
|
||||||
|
StartCoroutine(StartWorkShift());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
IEnumerator StartWorkShift()
|
||||||
|
{
|
||||||
|
while (remainingTime > 0)
|
||||||
|
{
|
||||||
|
remainingTime -= Time.deltaTime;
|
||||||
|
|
||||||
|
Debug.Log("Shift: " + remainingTime);
|
||||||
|
yield return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
EndShift();
|
||||||
|
}
|
||||||
|
|
||||||
|
void EndShift()
|
||||||
|
{
|
||||||
|
Debug.Log("Shift ended!");
|
||||||
|
|
||||||
|
/*
|
||||||
|
shiftTrigger.enabled = true;
|
||||||
|
*/
|
||||||
|
remainingTime = shiftDuration;
|
||||||
|
shiftStarted = false;
|
||||||
|
}
|
||||||
|
}
|
11
SSLR/Assets/Scripts/ShiftManager.cs.meta
Normal file
11
SSLR/Assets/Scripts/ShiftManager.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0bab791ccf13189449b82b8f0b70b269
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Loading…
Add table
Reference in a new issue