Merge branch 'fix/safe-zone-spawn-pos' into 'main'

respawn in middle of safe zone

Closes #117

See merge request kernel-panic/revival!58
This commit is contained in:
Cinder Foster-Smith 2021-03-25 19:04:48 +00:00
commit 35fd443bd0
3 changed files with 21 additions and 24 deletions

View File

@ -48,7 +48,7 @@ MeshRenderer:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1150255153773548759}
m_Enabled: 1
m_Enabled: 0
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1

View File

@ -1485,10 +1485,6 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3340651998927408399, guid: e182e6daf2f187b45a07e7c89e3f1b55, type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3340651998927408401, guid: e182e6daf2f187b45a07e7c89e3f1b55, type: 3}
propertyPath: m_Name
value: Kill Plane
@ -2739,15 +2735,15 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4449396798674854634, guid: 373acc46f7fa7eb4b9cfba9c3e17b6ca, type: 3}
propertyPath: m_LocalScale.x
value: 0.32097137
value: 2.072769
objectReference: {fileID: 0}
- target: {fileID: 4449396798674854634, guid: 373acc46f7fa7eb4b9cfba9c3e17b6ca, type: 3}
propertyPath: m_LocalScale.z
value: 0.15426409
value: 1.5557534
objectReference: {fileID: 0}
- target: {fileID: 4449396798674854634, guid: 373acc46f7fa7eb4b9cfba9c3e17b6ca, type: 3}
propertyPath: m_LocalPosition.x
value: 8.435
value: 7.963
objectReference: {fileID: 0}
- target: {fileID: 4449396798674854634, guid: 373acc46f7fa7eb4b9cfba9c3e17b6ca, type: 3}
propertyPath: m_LocalPosition.y
@ -2755,7 +2751,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4449396798674854634, guid: 373acc46f7fa7eb4b9cfba9c3e17b6ca, type: 3}
propertyPath: m_LocalPosition.z
value: -0.523
value: 0.1
objectReference: {fileID: 0}
- target: {fileID: 4449396798674854634, guid: 373acc46f7fa7eb4b9cfba9c3e17b6ca, type: 3}
propertyPath: m_LocalRotation.w
@ -3374,15 +3370,15 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4449396798674854634, guid: 373acc46f7fa7eb4b9cfba9c3e17b6ca, type: 3}
propertyPath: m_LocalScale.x
value: 0.32097137
value: 3.5285494
objectReference: {fileID: 0}
- target: {fileID: 4449396798674854634, guid: 373acc46f7fa7eb4b9cfba9c3e17b6ca, type: 3}
propertyPath: m_LocalScale.z
value: 0.09717957
value: 1.2645004
objectReference: {fileID: 0}
- target: {fileID: 4449396798674854634, guid: 373acc46f7fa7eb4b9cfba9c3e17b6ca, type: 3}
propertyPath: m_LocalPosition.x
value: 2.677
value: 2.802
objectReference: {fileID: 0}
- target: {fileID: 4449396798674854634, guid: 373acc46f7fa7eb4b9cfba9c3e17b6ca, type: 3}
propertyPath: m_LocalPosition.y
@ -3390,7 +3386,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4449396798674854634, guid: 373acc46f7fa7eb4b9cfba9c3e17b6ca, type: 3}
propertyPath: m_LocalPosition.z
value: 7.077
value: 6.911
objectReference: {fileID: 0}
- target: {fileID: 4449396798674854634, guid: 373acc46f7fa7eb4b9cfba9c3e17b6ca, type: 3}
propertyPath: m_LocalRotation.w
@ -4210,15 +4206,15 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4449396798674854634, guid: 373acc46f7fa7eb4b9cfba9c3e17b6ca, type: 3}
propertyPath: m_LocalScale.x
value: 0.1499977
value: 1.6366249
objectReference: {fileID: 0}
- target: {fileID: 4449396798674854634, guid: 373acc46f7fa7eb4b9cfba9c3e17b6ca, type: 3}
propertyPath: m_LocalScale.z
value: 0.37136212
value: 1.8758615
objectReference: {fileID: 0}
- target: {fileID: 4449396798674854634, guid: 373acc46f7fa7eb4b9cfba9c3e17b6ca, type: 3}
propertyPath: m_LocalPosition.x
value: -5.143
value: -4.686
objectReference: {fileID: 0}
- target: {fileID: 4449396798674854634, guid: 373acc46f7fa7eb4b9cfba9c3e17b6ca, type: 3}
propertyPath: m_LocalPosition.y
@ -4226,7 +4222,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4449396798674854634, guid: 373acc46f7fa7eb4b9cfba9c3e17b6ca, type: 3}
propertyPath: m_LocalPosition.z
value: 22.181
value: 21.23
objectReference: {fileID: 0}
- target: {fileID: 4449396798674854634, guid: 373acc46f7fa7eb4b9cfba9c3e17b6ca, type: 3}
propertyPath: m_LocalRotation.w
@ -6045,23 +6041,23 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4449396798674854634, guid: 373acc46f7fa7eb4b9cfba9c3e17b6ca, type: 3}
propertyPath: m_LocalScale.x
value: 0.149289
value: 1.7674171
objectReference: {fileID: 0}
- target: {fileID: 4449396798674854634, guid: 373acc46f7fa7eb4b9cfba9c3e17b6ca, type: 3}
propertyPath: m_LocalScale.z
value: 0.37136212
value: 1.8337119
objectReference: {fileID: 0}
- target: {fileID: 4449396798674854634, guid: 373acc46f7fa7eb4b9cfba9c3e17b6ca, type: 3}
propertyPath: m_LocalPosition.x
value: -1.25
value: -1.478
objectReference: {fileID: 0}
- target: {fileID: 4449396798674854634, guid: 373acc46f7fa7eb4b9cfba9c3e17b6ca, type: 3}
propertyPath: m_LocalPosition.y
value: 3.023
value: 3.111
objectReference: {fileID: 0}
- target: {fileID: 4449396798674854634, guid: 373acc46f7fa7eb4b9cfba9c3e17b6ca, type: 3}
propertyPath: m_LocalPosition.z
value: 13.88
value: 14.354
objectReference: {fileID: 0}
- target: {fileID: 4449396798674854634, guid: 373acc46f7fa7eb4b9cfba9c3e17b6ca, type: 3}
propertyPath: m_LocalRotation.w

View File

@ -16,6 +16,9 @@ public class SafeZone : MonoBehaviour
{
if (other.gameObject.CompareTag(PLAYER))
{
// set position to middle of safe zone
_respawnPosition.Value = transform.position;
// start counting safe time when we enter a safe zone
_safeTime.Value = 0;
}
@ -26,8 +29,6 @@ public class SafeZone : MonoBehaviour
// Check if other game object is Player.
if (other.gameObject.CompareTag(PLAYER))
{
_respawnPosition.Value = other.gameObject.transform.position;
// TODO: does this have implications for the time freeze ability?
_safeTime.Value += Time.deltaTime;
}