Updated level and replay

This commit is contained in:
2026-01-19 11:16:25 +00:00
parent a9dfc40efb
commit 6c0db57956
11 changed files with 8154 additions and 5648 deletions

View File

@@ -25,6 +25,7 @@ namespace InterfaceOff.WorldScene
private float MousePitch;
private float MouseYaw = 90;
private int CurrentFrameIndex;
private List<PlayerFrameInfo> FrameInfo = new();
@@ -48,16 +49,19 @@ namespace InterfaceOff.WorldScene
Debug.Log("Dumped");
}
private void FixedUpdate()
{
PlayerFrameInfo current = new()
{
Position = transform.position,
Rotation = new Vector2(MousePitch, MouseYaw)
Rotation = new Vector2(MousePitch, MouseYaw),
ShootGun = Input.GetMouseButton(0),
FrameIndex = CurrentFrameIndex
};
FrameInfo.Add(current);
CurrentFrameIndex++;
}
private void Update()

View File

@@ -20,12 +20,14 @@ namespace InterfaceOff.WorldScene
private void Awake()
{
/* Loads the JSON, temporary. TODO: Insert the JSON into this .cs file */
string json = File.ReadAllText(Application.dataPath + "/Resources/playerframe.json");
Frames = JsonUtility.FromJson<PlayerFrameInfoArray>(json).FrameInfo;
}
private void FixedUpdate()
{
/* Iterates the frame index */
FrameIndex = (FrameIndex + 1) % (Frames.Length - 2);
}
@@ -47,7 +49,7 @@ namespace InterfaceOff.WorldScene
BulletTracerRenderer.SetPosition(index: 0, BulletTracerStart.position);
BulletTracerRenderer.SetPosition(index: 1, BulletTracerEnd.position);
//BulletTracerRenderer.enabled = Frames[FrameIndex].ShootGun;
BulletTracerRenderer.enabled = Frames[FrameIndex].ShootGun;
}
}
}