Skip to content

Commit

Permalink
final
Browse files Browse the repository at this point in the history
  • Loading branch information
Roi-Bruchim committed Dec 10, 2024
1 parent d0eac87 commit a24b450
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 19 deletions.
6 changes: 2 additions & 4 deletions Assets/Scripts/Heartbeat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ public class Heartbeat : MonoBehaviour
[SerializeField, Tooltip("Time to complete one heartbeat (in seconds)")]
private float m_Period = 1.5f; // Time it takes for one full heartbeat

void Start()
{
void Start(){
}

// Update is called once per frame
void Update()
{
void Update(){
// Time-based heartbeat
float time = Time.time / m_Period; // Normalize time based on the period
float offset = Mathf.Cos(2.0f * Mathf.PI * time); // Smooth oscillation between -1 and 1
Expand Down
6 changes: 2 additions & 4 deletions Assets/Scripts/Hide.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ public class Hide : MonoBehaviour

private Renderer m_Renderer;

void Start()
{
void Start(){
// Get the Renderer component of the object
m_Renderer = GetComponent<Renderer>();
}

void Update()
{
void Update(){
// Toggles visibility when the key is pressed
if (Input.GetKeyDown(m_HideKey))
{
Expand Down
8 changes: 3 additions & 5 deletions Assets/Scripts/Oscillator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ public class Oscillator : MonoBehaviour

private Vector3 m_StartPosition;

void Start()
{
void Start(){
// Record the starting position of the object
m_StartPosition = transform.position;
}

void Update()
{
void Update(){
// Time-based oscillation
float time = Time.time / m_Period; // Normalize time based on the period
float offset = Mathf.Cos(2.0f * Mathf.PI * time); // Smooth oscillation between -1 and 1
Expand All @@ -28,5 +26,5 @@ void Update()

// Update the transform position
transform.position = pos;
}
}
}
3 changes: 1 addition & 2 deletions Assets/Scripts/Rotator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ public class Rotator : MonoBehaviour
[SerializeField, Tooltip("Speed of rotation")]
public Vector3 rotationSpeed = new Vector3(0, 100, 0);

void Update()
{
void Update(){
transform.Rotate(rotationSpeed * Time.deltaTime);
}
}
6 changes: 2 additions & 4 deletions Assets/Scripts/mover.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ public class mover : MonoBehaviour
float speed = 1.0f;

// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
void Start(){
//Debug.Log("Starting");
}

// Update is called once per frame
void Update()
{
void Update(){
// GetComponent<Transform>().Position += new Vector3(speed * Time.deltaTime, 0, 0);
transform.position += new Vector3(speed * Time.deltaTime, 0, 0);

Expand Down

0 comments on commit a24b450

Please sign in to comment.