merge feat/level/create-level-1 : keep the most recent

This commit is contained in:
Pierre Ryssen
2026-03-30 17:23:31 +02:00
44 changed files with 25882 additions and 9954 deletions

View File

@@ -32,6 +32,8 @@ public class WallInteractButton : MonoBehaviour
private Vector3 m_buttonPressedPos;
private bool m_isVisuallyPressed;
public PlayerHeadController headController;
private void Reset()
{
Collider col = GetComponent<Collider>();
@@ -49,7 +51,7 @@ public class WallInteractButton : MonoBehaviour
private void Update()
{
if (m_playerInRange && Keyboard.current != null && Keyboard.current[interactKey].wasPressedThisFrame)
if (!headController.isHoldingHead && m_playerInRange && Keyboard.current != null && Keyboard.current[interactKey].wasPressedThisFrame)
{
TryInteract();
}

View File

@@ -5,10 +5,12 @@ public class PlayerHeadController : MonoBehaviour
public Transform Head;
public Transform CameraTransform;
public float ThrowForce = 10f;
public float PickupDistance = 3f;
public Transform BodyTransform;
public bool isHoldingHead = true;
public float ThrowForce;
public float PickupDistance;
public bool isHoldingHead;
private Rigidbody m_headRigidbody;
@@ -28,8 +30,13 @@ public class PlayerHeadController : MonoBehaviour
{
Cursor.lockState = CursorLockMode.Locked;
m_headInitialLocalPos = Head.localPosition;
m_headInitialLocalRot = Head.localRotation;
Vector3 offset = new Vector3(0f, -0.5f, 0.5f);
m_headInitialLocalPos = BodyTransform.localPosition + offset;
m_headInitialLocalRot = BodyTransform.localRotation;
m_headRigidbody = Head.GetComponent<Rigidbody>();
Head.SetParent(null);
}
void Update()
@@ -55,6 +62,7 @@ public class PlayerHeadController : MonoBehaviour
private void DropHead()
{
Debug.Log("DropHead");
animator.SetTrigger("Throw");
isHoldingHead = false;
@@ -72,6 +80,7 @@ public class PlayerHeadController : MonoBehaviour
private void ThrowHead()
{
Debug.Log("ThrowHead");
if (!isHoldingHead)
return;
@@ -95,6 +104,7 @@ public class PlayerHeadController : MonoBehaviour
private void PickupHead()
{
Debug.Log("PickupHead");
isHoldingHead = true;
if (m_headRigidbody != null)

View File

@@ -1,19 +0,0 @@
{
"lines": [
{
"speaker": "SYSTEME",
"text": "...Ici, quelque chose cloche.",
"duration": 2.5
},
{
"speaker": "SYSTEME",
"text": "Reste calme. Observe la piece.",
"duration": 2.5
},
{
"speaker": "SYSTEME",
"text": "Trouve une sortie.",
"duration": 2.2
}
]
}

View File

@@ -0,0 +1,29 @@
{
"lines": [
{
"speaker": "SYSTEME",
"text": "Hello, UNIT SB-3954. You are in a simulation for testing your ability to move and interact.",
"duration": 6.5
},
{
"speaker": "SYSTEME",
"text": "Your goal is to prove that your system is working and that you can move and interact with the environment.",
"duration": 5
},
{
"speaker": "SYSTEME",
"text": "To move, use ZQSD. To interact with objects, use \"E\".",
"duration": 5
},
{
"speaker": "SYSTEME",
"text": "You can also use the mouse to look around, and use Left Click to launch your head.",
"duration": 3
},
{
"speaker": "SYSTEME",
"text": "Good luck, UNIT SB-3954.",
"duration": 3
}
]
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: c4b9d13b29337441dbdb06a8a45e32c3
guid: 1e42d860d90034c58a6600de98c72204
TextScriptImporter:
externalObjects: {}
userData:

View File

@@ -0,0 +1,29 @@
{
"lines": [
{
"speaker": "SYSTEME",
"text": "Good job, UNIT SB-3954. You have successfully completed the first test.",
"duration": 4.5
},
{
"speaker": "SYSTEME",
"text": "I see that your module of ejection of your head is still working.",
"duration": 4
},
{
"speaker": "SYSTEME",
"text": "Now that you understand you can launch your head, use your head to see at a different angle.",
"duration": 5
},
{
"speaker": "SYSTEME",
"text": "You lift your head and look around, for that use \"R\".",
"duration": 3
},
{
"speaker": "SYSTEME",
"text": "Use this to find the code for the door.",
"duration": 4.5
}
]
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 7c5bd5fd82b7a498aa62659593ea5cef
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: