This commit is contained in:
Gerard Gascón 2025-02-02 23:44:44 +01:00
commit f5c1616018
679 changed files with 188502 additions and 0 deletions

View file

@ -0,0 +1,19 @@
using System;
using UnityEngine;
using Random = UnityEngine.Random;
public class Casteller : MonoBehaviour {
[SerializeField] private float indexCagat;
[SerializeField] private float shakeAmplitude = .1f;
[SerializeField] private float shakeFrequency = 1f;
[SerializeField] private Transform childPivot;
private void Awake() {
shakeAmplitude = Random.Range(.001f, .01f);
shakeFrequency = Random.Range(1f, 10f);
}
private void Update() {
childPivot.localPosition = new Vector3(Mathf.Cos(Time.time * shakeFrequency) * 2f - 1f, 0, Mathf.Sin(Time.time * shakeFrequency) * 2f - 1f) * shakeAmplitude;
}
}