4 Commits

Author SHA1 Message Date
Pierre Ryssen
7f2c58f864 feat (rootEnemies): create a slowdown area that slow the player 2026-04-29 23:16:46 +02:00
Pierre Ryssen
7a4f79ac6b feat (architecture): create an 'Enemies' directory and 'LivingRoot' directory in Script 2026-04-26 18:34:11 +02:00
Pierre Ryssen
14310f742f feat: add the personnal devroom directory 2026-04-26 18:22:56 +02:00
Pierre Ryssen
4a3f0ec740 feat (.gitignore): add the DevRoom/Perso/ in the .gitignore 2026-04-26 16:20:34 +02:00
11 changed files with 1258 additions and 125 deletions

4
.gitignore vendored
View File

@@ -61,4 +61,6 @@ Thumbs.db.meta
# VS Code
*.vscode
.vsconfig
.vsconfig
Assets/Level/Scenes/DevRoom/Perso/

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d82ed499bde37d2bca7590ba5952894f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 91ac6bdb3a3fc30fa9e96966372092e3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,46 @@
using UnityEngine;
public class SlowdownArea : MonoBehaviour
{
[Header("References")]
public float maxSlow;
public float slowSpeed;
public float timer;
private float baseSpeed;
private bool isInZone = false;
private PlayerMovement player;
private void OnTriggerEnter(Collider area)
{
if (area.CompareTag("Player")){
player = area.GetComponent<PlayerMovement>();
baseSpeed = player.WalkSpeed;
isInZone = true;
}
}
private void OnTriggerExit(Collider area)
{
if (area.CompareTag("Player"))
{
isInZone = false;
timer = 0f;
player.WalkSpeed = baseSpeed;
}
}
// Update is called once per frame
void Update()
{
if (!isInZone || player == null)
return;
timer += Time.deltaTime;
float t = Mathf.Clamp(timer * slowSpeed, 0f, 1f);
float multiplicator = Mathf.Lerp(1f, maxSlow, t);
player.WalkSpeed = baseSpeed * multiplicator;
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: dbfa6ebdeb68bf2f6a5c4d25311b5811

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a969c937a6e399209adc938b2591a18e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -36814,67 +36814,6 @@ Transform:
m_Children: []
m_Father: {fileID: 1994839082}
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
--- !u!1001 &616194330
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1945301683602458784, guid: c786dcd5f720bb47dbf843bd97137452, type: 3}
propertyPath: m_LocalPosition.x
value: 7.143099
objectReference: {fileID: 0}
- target: {fileID: 1945301683602458784, guid: c786dcd5f720bb47dbf843bd97137452, type: 3}
propertyPath: m_LocalPosition.y
value: 0.5499998
objectReference: {fileID: 0}
- target: {fileID: 1945301683602458784, guid: c786dcd5f720bb47dbf843bd97137452, type: 3}
propertyPath: m_LocalPosition.z
value: -11.581879
objectReference: {fileID: 0}
- target: {fileID: 1945301683602458784, guid: c786dcd5f720bb47dbf843bd97137452, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1945301683602458784, guid: c786dcd5f720bb47dbf843bd97137452, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1945301683602458784, guid: c786dcd5f720bb47dbf843bd97137452, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1945301683602458784, guid: c786dcd5f720bb47dbf843bd97137452, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1945301683602458784, guid: c786dcd5f720bb47dbf843bd97137452, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1945301683602458784, guid: c786dcd5f720bb47dbf843bd97137452, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1945301683602458784, guid: c786dcd5f720bb47dbf843bd97137452, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8295937476714018201, guid: c786dcd5f720bb47dbf843bd97137452, type: 3}
propertyPath: m_Name
value: ThrowableCube
objectReference: {fileID: 0}
- target: {fileID: 8295937476714018201, guid: c786dcd5f720bb47dbf843bd97137452, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c786dcd5f720bb47dbf843bd97137452, type: 3}
--- !u!43 &696562523
Mesh:
m_ObjectHideFlags: 0
@@ -108275,67 +108214,6 @@ Transform:
m_Children: []
m_Father: {fileID: 1021798998}
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
--- !u!1001 &1679253409
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1945301683602458784, guid: c786dcd5f720bb47dbf843bd97137452, type: 3}
propertyPath: m_LocalPosition.x
value: 6.8145223
objectReference: {fileID: 0}
- target: {fileID: 1945301683602458784, guid: c786dcd5f720bb47dbf843bd97137452, type: 3}
propertyPath: m_LocalPosition.y
value: 1.5500001
objectReference: {fileID: 0}
- target: {fileID: 1945301683602458784, guid: c786dcd5f720bb47dbf843bd97137452, type: 3}
propertyPath: m_LocalPosition.z
value: -11.941306
objectReference: {fileID: 0}
- target: {fileID: 1945301683602458784, guid: c786dcd5f720bb47dbf843bd97137452, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1945301683602458784, guid: c786dcd5f720bb47dbf843bd97137452, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1945301683602458784, guid: c786dcd5f720bb47dbf843bd97137452, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1945301683602458784, guid: c786dcd5f720bb47dbf843bd97137452, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1945301683602458784, guid: c786dcd5f720bb47dbf843bd97137452, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1945301683602458784, guid: c786dcd5f720bb47dbf843bd97137452, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1945301683602458784, guid: c786dcd5f720bb47dbf843bd97137452, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8295937476714018201, guid: c786dcd5f720bb47dbf843bd97137452, type: 3}
propertyPath: m_Name
value: ThrowableCube (1)
objectReference: {fileID: 0}
- target: {fileID: 8295937476714018201, guid: c786dcd5f720bb47dbf843bd97137452, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c786dcd5f720bb47dbf843bd97137452, type: 3}
--- !u!43 &1713424934
Mesh:
m_ObjectHideFlags: 0
@@ -144558,7 +144436,5 @@ SceneRoots:
- {fileID: 2145812611}
- {fileID: 153565765}
- {fileID: 581107447}
- {fileID: 616194330}
- {fileID: 1679253409}
- {fileID: 525042218}
- {fileID: 1004343558}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0ade185cbfcac340bb27b3e5084f5c32
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

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