mirror of
https://github.com/boudji-ludwig-pett/cnam-geometry-dash.git
synced 2025-12-11 00:27:48 +01:00
fix: rotation, smooth camera, ship portal collider, obstacle block collider, player rigid body detection, dynamic ground (#54)
This commit is contained in:
@@ -7,6 +7,7 @@ public class LevelLoader : MonoBehaviour
|
||||
public LevelsLoader levelsLoader;
|
||||
public AudioSource audioSource;
|
||||
public Text progressionText;
|
||||
private readonly float groundY = -6.034f;
|
||||
|
||||
private GameObject GetPrefab(string type)
|
||||
{
|
||||
@@ -43,6 +44,12 @@ public class LevelLoader : MonoBehaviour
|
||||
|
||||
instance.transform.localScale = new Vector3(newScaleX, newScaleY, originalScale.z);
|
||||
}
|
||||
|
||||
GameObject groundPrefab = GetPrefab("Ground");
|
||||
GameObject groundInstance = Instantiate(groundPrefab, new Vector3(current.LastX / 2, groundY, 0), Quaternion.identity);
|
||||
float groundWidth = current.LastX;
|
||||
groundInstance.transform.localScale = new Vector3(groundWidth / 5f * 2, 1, 1);
|
||||
|
||||
Instantiate(GetPrefab("WinnerWall"), new Vector3(current.LastX, 0, 0), Quaternion.Euler(0, 0, 90));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user