move everything into scene folders

This commit is contained in:
ntr committed 2022-03-28 23:40:04 +11:00
1 parent 677b182888
commit 71368ec095
80 files changed
+2196 -11989

No files matched your search

+47
View File
@@ -0,0 +1,47 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine.VFX;
using UnityEngine;
public class WavzController : MonoBehaviour
{
public float bpm;
public float beatsPerBar;
public float barsPerPhrase;
public float phraseLengthSec;
public float min;
public float max;
private VisualEffect vfx;
void Start() {
vfx = gameObject.GetComponent<VisualEffect>();
min = 0.5f;
max = 128f;
bpm = 120f;
// assume 4 beats per bar * 8 bars per phrase
beatsPerBar = 4.0f;
barsPerPhrase = 8.0f;
phraseLengthSec = (bpm / 60.0f) * beatsPerBar * barsPerPhrase;
Debug.Log($"phrase length in seconds {phraseLengthSec}");
}
void Update() {
float x = max * Mathf.Abs(Mathf.Sin(Time.time / phraseLengthSec)) + min;
float y = max * Mathf.Abs(Mathf.Sin( Time.time / (phraseLengthSec / 2))) + min;
float z = max * Mathf.Abs(Mathf.Sin(Time.time / (phraseLengthSec / 3))) + min;
vfx.SetFloat("AttractionSpeed", y);
vfx.SetFloat("AttractionForce", y);
vfx.SetFloat("StickDistance", z);
vfx.SetFloat("StickForce", z);
}
public void SetStickiness(float v) {
// vfx.SetFloat("StickDistance", z);
// vfx.SetFloat("StickForce", z);
}
}