Made first level IG

This commit is contained in:
2025-04-25 14:46:41 +01:00
parent 06010f27ef
commit f803d0ed83
18 changed files with 6813 additions and 9 deletions

BIN
Assets/New Terrain.asset Normal file

Binary file not shown.

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 308a079075a9062408cababc03375a5f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 15600000
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

@@ -0,0 +1,31 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dda436a9c8bbd4d109478acf25cd48d8, type: 3}
m_Name: Default Color Palette
m_EditorClassIdentifier:
m_Colors:
- {r: 0, g: 0.122, b: 0.247, a: 1}
- {r: 0, g: 0.455, b: 0.851, a: 1}
- {r: 0.498, g: 0.859, b: 1, a: 1}
- {r: 0.224, g: 0.8, b: 0.8, a: 1}
- {r: 0.239, g: 0.6, b: 0.439, a: 1}
- {r: 0.18, g: 0.8, b: 0.251, a: 1}
- {r: 0.004, g: 1, b: 0.439, a: 1}
- {r: 1, g: 0.863, b: 0, a: 1}
- {r: 1, g: 0.522, b: 0.106, a: 1}
- {r: 1, g: 0.255, b: 0.212, a: 1}
- {r: 0.522, g: 0.078, b: 0.294, a: 1}
- {r: 0.941, g: 0.071, b: 0.745, a: 1}
- {r: 0.694, g: 0.051, b: 0.788, a: 1}
- {r: 0.067, g: 0.067, b: 0.067, a: 1}
- {r: 0.667, g: 0.667, b: 0.667, a: 1}
- {r: 0.867, g: 0.867, b: 0.867, a: 1}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6d1657ee5cb137b47a22c3dce235194a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,25 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3f1ca63a91b17724bbd99c8fa67e0180, type: 3}
m_Name: Default Material Palette
m_EditorClassIdentifier:
array:
- {fileID: 2100000, guid: c22777d6e868e4f2fb421913386b154e, type: 2}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 438e86f4f5c49004ead6c7eefca96a3e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

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

View File

@@ -6162,6 +6162,10 @@ PrefabInstance:
propertyPath: m_PortalB
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4470023418895194988, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3}
propertyPath: m_AngleDif
value: 180
objectReference: {fileID: 0}
- target: {fileID: 4470023418895194988, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3}
propertyPath: m_PlayerTag
value: Player
@@ -12075,6 +12079,10 @@ PrefabInstance:
propertyPath: m_PortalB
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4470023418895194988, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3}
propertyPath: m_AngleDif
value: 180
objectReference: {fileID: 0}
- target: {fileID: 4470023418895194988, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3}
propertyPath: m_PlayerTag
value: Player

View File

@@ -23,8 +23,8 @@ public partial class PlayerMovement : MonoBehaviour
{ m_State = PlayerState.SLIDING; }
// Checks if the player is in the wall running state
else if (GetNormalOfClosestCollider(out m_WallNormal) && m_WallRunKeyPressed)
{ m_State = PlayerState.WALL_RUNNING; }
// else if (GetNormalOfClosestCollider(out m_WallNormal) && m_WallRunKeyPressed)
// { m_State = PlayerState.WALL_RUNNING; }
// Defaults to ruuning
else { m_State = PlayerState.RUNNING; }

View File

@@ -7,9 +7,11 @@ public partial class PlayerMovement : MonoBehaviour
private void UpdateInput()
{
// Calls get axis raw to ignore any uneeded scaling
m_Input.x = Input.GetAxisRaw("Horizontal");
//m_Input.x = Input.GetAxisRaw("Horizontal");
m_Input.y = Input.GetAxisRaw("Vertical");
m_Input.y = Mathf.Clamp(m_Input.y, 0, Mathf.Infinity);
// Updates key press states
m_JumpKeyPressed = Input.GetKey(m_JumpKey);
m_SlidingKeyPressed = Input.GetKey(m_SlideKey);

View File

@@ -8,8 +8,14 @@ public partial class PlayerMovement : MonoBehaviour
Collider closest = null;
foreach (Collider collision in m_WallCollisions)
{
Vector3 pos = collision.ClosestPoint(transform.position);
{
Vector3 pos = Vector3.zero;
if (collision.GetType() != typeof(MeshCollider))
{
pos = collision.ClosestPoint(transform.position);
}
Vector3 dif = transform.position - pos;
float distance = dif.magnitude;

View File

@@ -59,6 +59,9 @@ public class PortalCamera : MonoBehaviour
float angle = Quaternion.Angle(m_DisplayPortal.transform.parent.rotation, m_CapturePortal.transform.parent.rotation);
Quaternion rotDif = Quaternion.AngleAxis(angle, Vector3.up);
Vector3 newCamDir = rotDif * CameraController.Instance().transform.forward;
transform.parent.eulerAngles = Quaternion.LookRotation(newCamDir, Vector3.up).eulerAngles + m_Rot;
//Vector3 d = new(m_CapturePortal.CamDif(), 0f, 0f);
//Vector3 d = new(0f, 0f, m_CapturePortal.CamDif());
Vector3 d = new(0f, m_CapturePortal.CamDif(), 0f);
transform.parent.eulerAngles = Quaternion.LookRotation(newCamDir, Vector3.up).eulerAngles + m_Rot + d;
}
}

View File

@@ -5,6 +5,7 @@ public class PortalManager : MonoBehaviour
[Header("References")]
[SerializeField] GameObject m_OtherPortal;
[SerializeField] float m_AngleDif;
[SerializeField] float m_CamDif;
[Header("Set References")]
[SerializeField] GameObject m_CameraPrefab;
@@ -24,6 +25,8 @@ public class PortalManager : MonoBehaviour
// Gets the location of the player relative to the portal
public Vector3 PlayerOffset() => m_PlayerPoint.localPosition;
public float CamDif() => m_CamDif;
static bool s_TeleportedThisFrame = false;
// Start is called before the first frame update