init
This commit is contained in:
commit
f5c1616018
679 changed files with 188502 additions and 0 deletions
19
Assets/Scripts/Casteller.cs
Normal file
19
Assets/Scripts/Casteller.cs
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue