Compare commits

...

3 commits

8 changed files with 148 additions and 197 deletions

View file

@ -190,7 +190,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 3a46a62138bd3774aa62b76560629f46, type: 3}
m_Name:
m_EditorClassIdentifier:
interactionPrompt: press [E] to open lift door
interactionPrompt:
door: {fileID: 0}
liftController: {fileID: 0}
--- !u!65 &6504267406812371461

View file

@ -122,154 +122,6 @@ NavMeshSettings:
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1001 &1120089
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 974238578668270704, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 974238578668270716, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
propertyPath: m_Actions
value:
objectReference: {fileID: -944628639613478452, guid: 4419d82f33d36e848b3ed5af4c8da37e,
type: 3}
- target: {fileID: 974238578668270716, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2119775930974504096, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
propertyPath: m_LocalPosition.x
value: -11.310009
objectReference: {fileID: 0}
- target: {fileID: 2119775930974504096, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
propertyPath: m_LocalPosition.y
value: 14.179999
objectReference: {fileID: 0}
- target: {fileID: 2119775930974504096, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
propertyPath: m_LocalPosition.z
value: -37.019993
objectReference: {fileID: 0}
- target: {fileID: 2119775930974504096, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
propertyPath: m_LocalRotation.w
value: -0.9914804
objectReference: {fileID: 0}
- target: {fileID: 2119775930974504096, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 2119775930974504096, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
propertyPath: m_LocalRotation.y
value: 0.13025612
objectReference: {fileID: 0}
- target: {fileID: 2119775930974504096, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 2119775930974504096, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2119775930974504096, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: -374.969
objectReference: {fileID: 0}
- target: {fileID: 2119775930974504096, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3128949090649374765, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
propertyPath: m_TagString
value: Player
objectReference: {fileID: 0}
- target: {fileID: 3203261902030644824, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
propertyPath: m_LocalPosition.x
value: 0.20000017
objectReference: {fileID: 0}
- target: {fileID: 3203261902030644824, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
propertyPath: m_LocalPosition.y
value: 0.4449997
objectReference: {fileID: 0}
- target: {fileID: 3203261902030644824, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
propertyPath: m_LocalPosition.z
value: -3.9999988
objectReference: {fileID: 0}
- target: {fileID: 5542111180780342640, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
propertyPath: m_BackGroundColor.a
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5542111180780342640, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
propertyPath: m_BackGroundColor.b
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5542111180780342640, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
propertyPath: m_BackGroundColor.g
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5542111180780342640, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
propertyPath: m_BackGroundColor.r
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5542111180780342642, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
propertyPath: m_TagString
value: MainCamera
objectReference: {fileID: 0}
- target: {fileID: 5542111180780342647, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
propertyPath: m_LocalPosition.x
value: 0.20000017
objectReference: {fileID: 0}
- target: {fileID: 5542111180780342647, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
propertyPath: m_LocalPosition.y
value: 0.4449997
objectReference: {fileID: 0}
- target: {fileID: 5542111180780342647, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
propertyPath: m_LocalPosition.z
value: -3.9999988
objectReference: {fileID: 0}
- target: {fileID: 8047161636021232021, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
propertyPath: m_Name
value: NestedParentArmature_Unpack
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 974238578668270704, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
insertIndex: -1
addedObject: {fileID: 491771526}
m_SourcePrefab: {fileID: 100100000, guid: c708a3b79cd542b42bbfedb17e213bc1, type: 3}
--- !u!1 &13596640
GameObject:
m_ObjectHideFlags: 0
@ -7350,29 +7202,6 @@ Mesh:
offset: 0
size: 0
path:
--- !u!1 &491771518 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 974238578668270704, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
m_PrefabInstance: {fileID: 1120089}
m_PrefabAsset: {fileID: 0}
--- !u!114 &491771526
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 491771518}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4995ad0b66292c144ab3819605824571, type: 3}
m_Name:
m_EditorClassIdentifier:
playerPosition: {fileID: 1013448445}
interactableDistance: 2
raycastLayers:
serializedVersion: 2
m_Bits: 439
--- !u!43 &554144876
Mesh:
m_ObjectHideFlags: 0
@ -9164,12 +8993,6 @@ Mesh:
offset: 0
size: 0
path:
--- !u!4 &1013448445 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 5542111180780342647, guid: c708a3b79cd542b42bbfedb17e213bc1,
type: 3}
m_PrefabInstance: {fileID: 1120089}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1060921175
GameObject:
m_ObjectHideFlags: 0
@ -25892,6 +25715,8 @@ MonoBehaviour:
m_EditorClassIdentifier:
guiInteractionPromptObject: {fileID: 1226619922}
guiHudObject: {fileID: 618797798}
guiCompletedMenuObject: {fileID: 395649654}
player: {fileID: 1934526679}
--- !u!4 &1766444915
Transform:
m_ObjectHideFlags: 0
@ -26807,6 +26632,80 @@ MonoBehaviour:
sourceAsset: {fileID: 9197481963319205126, guid: b5ee53c3e1d1258499a4641d355c972a,
type: 3}
m_SortingOrder: 0
--- !u!1001 &1934526678
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1276608354021537599, guid: fede53ad5812a1046bf12a85cacb875a,
type: 3}
propertyPath: m_LocalPosition.x
value: -10.63
objectReference: {fileID: 0}
- target: {fileID: 1276608354021537599, guid: fede53ad5812a1046bf12a85cacb875a,
type: 3}
propertyPath: m_LocalPosition.y
value: 14.54
objectReference: {fileID: 0}
- target: {fileID: 1276608354021537599, guid: fede53ad5812a1046bf12a85cacb875a,
type: 3}
propertyPath: m_LocalPosition.z
value: -37.36
objectReference: {fileID: 0}
- target: {fileID: 1276608354021537599, guid: fede53ad5812a1046bf12a85cacb875a,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1276608354021537599, guid: fede53ad5812a1046bf12a85cacb875a,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1276608354021537599, guid: fede53ad5812a1046bf12a85cacb875a,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1276608354021537599, guid: fede53ad5812a1046bf12a85cacb875a,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1276608354021537599, guid: fede53ad5812a1046bf12a85cacb875a,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1276608354021537599, guid: fede53ad5812a1046bf12a85cacb875a,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1276608354021537599, guid: fede53ad5812a1046bf12a85cacb875a,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7550015751290207618, guid: fede53ad5812a1046bf12a85cacb875a,
type: 3}
propertyPath: m_Name
value: player
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: fede53ad5812a1046bf12a85cacb875a, type: 3}
--- !u!1 &1934526679 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 7550015751290207618, guid: fede53ad5812a1046bf12a85cacb875a,
type: 3}
m_PrefabInstance: {fileID: 1934526678}
m_PrefabAsset: {fileID: 0}
--- !u!43 &2033145775
Mesh:
m_ObjectHideFlags: 0
@ -27146,7 +27045,7 @@ SceneRoots:
- {fileID: 438254297}
- {fileID: 567431775}
- {fileID: 1656492132}
- {fileID: 1120089}
- {fileID: 1934526678}
- {fileID: 1060921176}
- {fileID: 596429548}
- {fileID: 897146492}

View file

@ -48,6 +48,14 @@ public enum DoorType
/// </summary>
[HideInInspector] public bool opening;
/// <summary>
/// set the interaction prompt
/// </summary>
private void Awake()
{
interactionPrompt = "Press [E] to open the door";
}
/// <summary>
/// to interact with the door
/// </summary>

View file

@ -56,6 +56,11 @@ public enum DisplayState
/// </summary>
public GameObject player;
/// <summary>
/// color for the stopwatch when the player is running late
/// </summary>
private readonly Color _colorRunningLateRed = new(193, 39, 45);
/// <summary>
/// float to keep track of the elapsed play/run/speeder time
/// </summary>
@ -149,12 +154,23 @@ private void Start()
private void Update()
{
if (Paused) return;
_elapsedRunTime += Time.deltaTime;
var minutes = _elapsedRunTime / 60;
var seconds = _elapsedRunTime % 60;
var milliseconds = _elapsedRunTime * 1000 % 1000;
_uiLabelStopwatch.text = $"{minutes:00}:{seconds:00}.{milliseconds:000}";
var displayedElapsedRunTime = _elapsedRunTime;
var stopwatchPrefix = "";
if (_elapsedRunTime > 299.9999999999f)
{
stopwatchPrefix = "-";
displayedElapsedRunTime -= 10f;
_uiLabelStopwatch.style.color = _colorRunningLateRed;
}
var minutes = displayedElapsedRunTime / 60;
var seconds = displayedElapsedRunTime % 60;
var milliseconds = displayedElapsedRunTime * 1000 % 1000;
_uiLabelStopwatch.text = $"{stopwatchPrefix}{minutes:00}:{seconds:00}.{milliseconds:000}";
}
/// <summary>
@ -459,6 +475,7 @@ public void SetInteractionPrompt(string prompt)
/// </summary>
public void ClearInteractionPrompt()
{
_uiLabelInteractionPrompt.text = "";
_uiLabelInteractionPrompt.visible = false;
}
@ -480,8 +497,8 @@ public void ProperlyEndRun()
// scoring parameters
const float maxScore = 1000f;
const float maxTimeForMaxScore = 15f; // 2.5 minutes
const float maxTimeForMinScore = 180f; // 5 minutes
const float maxTimeForMaxScore = 120f; // 2.5 minutes
const float maxTimeForMinScore = 300f; // 5 minutes
var score = _elapsedRunTime switch
{

View file

@ -21,6 +21,14 @@ public class LiftDoorController : CommonInteractable
/// </summary>
[SerializeField] private LiftController liftController;
/// <summary>
/// set the interaction prompt
/// </summary>
private void Awake()
{
interactionPrompt = "Press [E] to call the lift";
}
/// <summary>
/// to call the open door function
/// </summary>

View file

@ -74,9 +74,21 @@ private void Update()
if (!_raycast) return;
var interactable = _hit.collider.GetComponent<CommonInteractable>();
if (!interactable)
{
// Debug.Log("not looking at an interactable object");
GameManager.Instance.ClearInteractionPrompt();
return;
}
// show an interaction prompt if we're looking at an interactable object
var prompt = _hit.collider.GetComponent<CommonInteractable>()?.interactionPrompt;
if (prompt != "") Debug.Log(prompt);
var prompt = interactable.interactionPrompt;
// Debug.Log(prompt);
if (prompt != "")
GameManager.Instance.SetInteractionPrompt(prompt);
else
GameManager.Instance.ClearInteractionPrompt();
}
/// <summary>

View file

@ -4,20 +4,26 @@
* description: interaction prompt demo with a probuilder donut
*/
using UnityEngine;
/// <summary>
/// demo donut interactable class
/// </summary>
public class PlaygroundDonut : CommonInteractable
{
private void OnTriggerEnter(Collider other)
/// <summary>
/// set the interaction prompt
/// </summary>
private void Awake()
{
GameManager.Instance.SetInteractionPrompt("This is a Donut");
interactionPrompt = "This is a Donut";
}
private void OnTriggerExit(Collider other)
{
GameManager.Instance.ClearInteractionPrompt();
}
// private void OnTriggerEnter(Collider other)
// {
// GameManager.Instance.SetInteractionPrompt("This is a Donut");
// }
//
// private void OnTriggerExit(Collider other)
// {
// GameManager.Instance.ClearInteractionPrompt();
// }
}

View file

@ -4,7 +4,8 @@
<ui:VisualElement name="HoriHolder" style="flex-grow: 1; flex-direction: column; max-height: 60%; margin-left: 10%; margin-right: 10%;">
<ui:VisualElement name="Logospace" style="flex-grow: 1; width: auto; flex-direction: row; padding-bottom: 6%; height: 50%; min-height: 50%;">
<ui:VisualElement name="Header" style="background-image: none; -unity-background-scale-mode: scale-to-fit; flex-grow: 1; flex-shrink: 0; align-items: center; justify-content: center; align-self: stretch;">
<ui:Label tabindex="-1" text="DNF" parse-escape-sequences="true" display-tooltip-when-elided="true" name="HeaderLabel" style="-unity-font: url(&quot;project://database/Assets/UI%20Toolkit/RLFonts/GODarkslide/GODarkslide-distressed.ttf?fileID=12800000&amp;guid=1f2f7dc4dddb45a4e91b4b96053f09f6&amp;type=3#GODarkslide-distressed&quot;); -unity-font-definition: url(&quot;project://database/Assets/UI%20Toolkit/RLFonts/GODarkslide/GODarkslide-distressed%20SDF.asset?fileID=11400000&amp;guid=e706151e7fb3790409b13d29b812a8ff&amp;type=2#GODarkslide-distressed SDF&quot;); font-size: 80px; color: rgb(255, 255, 255); -unity-text-align: upper-center; white-space: normal; text-overflow: clip; rotate: -12.347deg;" />
<ui:Label tabindex="-1" text="CMI" parse-escape-sequences="true" display-tooltip-when-elided="true" name="HeaderLabel" style="-unity-font: url(&quot;project://database/Assets/UI%20Toolkit/RLFonts/GODarkslide/GODarkslide-distressed.ttf?fileID=12800000&amp;guid=1f2f7dc4dddb45a4e91b4b96053f09f6&amp;type=3#GODarkslide-distressed&quot;); -unity-font-definition: url(&quot;project://database/Assets/UI%20Toolkit/RLFonts/GODarkslide/GODarkslide-distressed%20SDF.asset?fileID=11400000&amp;guid=e706151e7fb3790409b13d29b812a8ff&amp;type=2#GODarkslide-distressed SDF&quot;); font-size: 80px; color: rgb(255, 255, 255); -unity-text-align: upper-center; white-space: normal; text-overflow: clip; rotate: -12.347deg;" />
<ui:Label tabindex="-1" text="Did Not Finish" parse-escape-sequences="true" display-tooltip-when-elided="true" name="FinalScoreLabel" style="color: rgb(255, 255, 255); font-size: 28px; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0;" />
</ui:VisualElement>
</ui:VisualElement>
<ui:VisualElement name="Buttonspace" style="flex-grow: 1; width: 50%; min-width: 50%; height: 50%; min-height: 50%; align-items: center; justify-content: flex-end; align-self: center;">