Merge branch 'JumpCorrection' of https://github.com/ElPoyo266/AwesomeRunner- into dev
This commit is contained in:
commit
4181b857e1
@ -404,7 +404,7 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
<CurveStrengthY>k__BackingField: 0
|
||||
<CurveStrengthX>k__BackingField: 0
|
||||
curveOrigin: {fileID: 0}
|
||||
curveOrigin: {fileID: 963194228}
|
||||
--- !u!4 &533191358
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -528,7 +528,7 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 0}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
|
@ -8,9 +8,14 @@ public class ChunkGenerator : MonoBehaviour
|
||||
[SerializeField] private LaneSystem LaneSystem;
|
||||
public CoinPool CoinPool { get; private set; }
|
||||
[field: SerializeField] public List<ObstaclePool> ObstaclePools { get; private set; }
|
||||
|
||||
private bool isFirstChunk = true;
|
||||
public Chunk Generate(Chunk chunkToFill)
|
||||
{
|
||||
if (isFirstChunk)
|
||||
{
|
||||
isFirstChunk = false;
|
||||
return chunkToFill;
|
||||
}
|
||||
if (ObstaclePools.IsEmpty())
|
||||
return chunkToFill;
|
||||
var obstaclePool = ObstaclePools.GetRandomElement();
|
||||
@ -20,7 +25,11 @@ public class ChunkGenerator : MonoBehaviour
|
||||
obstacle.transform.localPosition = chunkToFill.Grid.GetRandomPosition();
|
||||
if (obstacle.IsOnAllLanes)
|
||||
{
|
||||
obstacle.transform.localPosition = new Vector3(LaneSystem.CenterLane * LaneSystem.LaneWidth, transform.localPosition.y, transform.localPosition.z);
|
||||
obstacle.transform.localPosition = new Vector3(
|
||||
LaneSystem.CenterLane * LaneSystem.LaneWidth,
|
||||
transform.localPosition.y,
|
||||
transform.localPosition.z
|
||||
);
|
||||
}
|
||||
return chunkToFill;
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user