AudioSelector
This commit is contained in:
1 parent
0df6510da7
commit
0cac336db2
24 files changed
+590
-412
No files matched your search
@@ -0,0 +1,23 @@
|
||||
using Assets.WasapiAudio.Scripts.Unity;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
public class AudioSelector : MonoBehaviour {
|
||||
public WasapiAudioSource[] sources;
|
||||
private int sources_i = 0;
|
||||
|
||||
void Awake() {
|
||||
sources_i = 0;
|
||||
Debug.Log($"{sources[sources_i]}");
|
||||
}
|
||||
|
||||
public void UseNextSource() {
|
||||
sources_i = (sources_i + 1) % sources.Length;
|
||||
}
|
||||
|
||||
public WasapiAudioSource CurrentSource() {
|
||||
return sources[sources_i];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fc21ac8b706913b47897e9f83d170bc5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,74 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.VFX;
|
||||
using UnityEngine.VFX.Utility;
|
||||
|
||||
namespace Assets.WasapiAudio.Scripts.Unity
|
||||
{
|
||||
[AddComponentMenu("VFX/Property Binders/Spectre - VFX SDF Binder")]
|
||||
[VFXBinder("Audio/Audio Spectrum Data to 3d SDF AttributeMap")]
|
||||
public class SpectreVfxSdfBinder : VfxAudioVisualizationEffect
|
||||
{
|
||||
[VFXPropertyBinding("System.UInt32"), SerializeField]
|
||||
protected ExposedProperty SpectrumSizeParameter = "SpectrumSize";
|
||||
|
||||
[VFXPropertyBinding("UnityEngine.Texture3D"), SerializeField]
|
||||
protected ExposedProperty SpectrumDataTextureParameter = "SpectrumDataTexture";
|
||||
|
||||
private Texture3D _texture;
|
||||
private Color[] _colorCache;
|
||||
|
||||
private int z = 0;
|
||||
|
||||
private void UpdateTexture()
|
||||
{
|
||||
if (_texture == null)
|
||||
{
|
||||
_texture = new Texture3D(SpectrumSize * 2, SpectrumSize * 2, SpectrumSize * 2, TextureFormat.RFloat, false);
|
||||
_texture.name = $"AudioSpectrumDataSDF{SpectrumSize}";
|
||||
_colorCache = new Color[
|
||||
SpectrumSize * 2 *
|
||||
SpectrumSize * 2 *
|
||||
SpectrumSize * 2
|
||||
];
|
||||
}
|
||||
|
||||
var spectrumData = GetSpectrumData();
|
||||
|
||||
// go from 0 to end of spectrum
|
||||
for (int x = 0; x < SpectrumSize; x++) {
|
||||
float height = spectrumData[x] * SpectrumSize * 2;
|
||||
|
||||
// go from 0 to double the spectrum height
|
||||
for (int y = 0; y < SpectrumSize * 2; y++) {
|
||||
float distance = (y - height);
|
||||
|
||||
var z_part = z * (SpectrumSize * 2 * SpectrumSize * 2);
|
||||
var y_part = y * SpectrumSize * 2;
|
||||
|
||||
_colorCache[z_part + y_part + (SpectrumSize + x)] = new Color(distance, 0, 0, 0);
|
||||
_colorCache[z_part + y_part + (SpectrumSize - (x + 1))] = new Color(distance, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
z = (z + 1) % (SpectrumSize * 2);
|
||||
|
||||
// Debug.Log($"{z}");
|
||||
|
||||
_texture.SetPixels(_colorCache);
|
||||
_texture.Apply();
|
||||
}
|
||||
|
||||
public override void UpdateBinding(VisualEffect component)
|
||||
{
|
||||
base.UpdateBinding(component);
|
||||
UpdateTexture();
|
||||
component.SetUInt(SpectrumSizeParameter, (uint) SpectrumSize);
|
||||
component.SetTexture(SpectrumDataTextureParameter, _texture);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "Audio Spectrum Data";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 42ceea4a053d2f244b3c6dd469a1fdfb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,90 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using Assets.WasapiAudio.Scripts.Unity;
|
||||
|
||||
[RequireComponent(typeof(Material))]
|
||||
public class SpectrumFullscreenPassBinder : MonoBehaviour {
|
||||
public WasapiAudioSource source;
|
||||
|
||||
private Texture2D _texture;
|
||||
private Color[] _colorCache;
|
||||
public Material material;
|
||||
|
||||
public Preferences preferences;
|
||||
|
||||
[SerializeReference]
|
||||
[SerializeReferenceButton]
|
||||
public List<SpectrumTransformer> Transformers = new List<SpectrumTransformer>();
|
||||
|
||||
[SpectrumDataPreview]
|
||||
public SpectrumData Preview;
|
||||
|
||||
private void Start() {
|
||||
if (source == null) {
|
||||
Debug.Log("Material Binder needs WASAPI Source.");
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
if (preferences == null) {
|
||||
Debug.Log("Material Binder needs Preferences.");
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void Update() {
|
||||
UpdateTexture();
|
||||
UpdateBinding();
|
||||
}
|
||||
|
||||
private void InitialiseTexture() {
|
||||
Debug.Log("Reinitialising spectrum texture...");
|
||||
// material = gameObject.GetComponent<Material>();
|
||||
_texture = new Texture2D(source.SpectrumSize, 1, TextureFormat.RFloat, false);
|
||||
_colorCache = new Color[source.SpectrumSize];
|
||||
_texture.name = $"AudioSpectrumData{source.SpectrumSize}";
|
||||
}
|
||||
|
||||
private float[] GetSpectrumData() {
|
||||
// Get raw / unmodified spectrum data
|
||||
var spectrumData = source.GetSpectrumData();
|
||||
|
||||
// Run spectrum data through all configured transformers
|
||||
if (Transformers != null && Transformers.Count > 0) {
|
||||
foreach (var transformer in Transformers) {
|
||||
spectrumData = transformer.Transform(spectrumData);
|
||||
}
|
||||
}
|
||||
|
||||
Preview.Values = spectrumData;
|
||||
|
||||
return spectrumData;
|
||||
}
|
||||
|
||||
private void UpdateTexture() {
|
||||
// init
|
||||
if (_texture == null) InitialiseTexture();
|
||||
|
||||
var spectrumData = GetSpectrumData();
|
||||
|
||||
for (int i = 0; i < source.SpectrumSize; i++) {
|
||||
_colorCache[i] = new Color(spectrumData[i], 0, 0, 0);
|
||||
}
|
||||
|
||||
_texture.SetPixels(_colorCache);
|
||||
_texture.Apply();
|
||||
}
|
||||
|
||||
public void UpdateBinding() {
|
||||
// !!!!
|
||||
// you must set these via a literal string for some raeson
|
||||
// having them as a public property didn't work
|
||||
material.SetFloat("_SpectrumSize", source.SpectrumSize);
|
||||
material.SetTexture("_SpectrumDataTexture", _texture);
|
||||
material.SetColor("_ThemeStart", preferences.Theme().Evaluate(0.0f));
|
||||
material.SetColor("_ThemeEnd", preferences.Theme().Evaluate(0.0f));
|
||||
}
|
||||
|
||||
public string ToString() {
|
||||
return "Spectrum Material Binder";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4d37d4f6cfd7c434b96f0de8adbdf88d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,93 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using Assets.WasapiAudio.Scripts.Unity;
|
||||
|
||||
[RequireComponent(typeof(Material))]
|
||||
public class SpectrumMaterialBinder : MonoBehaviour
|
||||
{
|
||||
public WasapiAudioSource source;
|
||||
|
||||
private Texture2D _texture;
|
||||
private Color[] _colorCache;
|
||||
private Material _material;
|
||||
|
||||
public Preferences preferences;
|
||||
|
||||
[SerializeReference]
|
||||
[SerializeReferenceButton]
|
||||
public List<SpectrumTransformer> Transformers = new List<SpectrumTransformer>();
|
||||
|
||||
[SpectrumDataPreview]
|
||||
public SpectrumData Preview;
|
||||
|
||||
private void Start() {
|
||||
if (source == null) {
|
||||
Debug.Log("Material Binder needs WASAPI Source.");
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
if (preferences == null) {
|
||||
Debug.Log("Material Binder needs Preferences.");
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void Update() {
|
||||
UpdateTexture();
|
||||
UpdateBinding();
|
||||
}
|
||||
|
||||
private void InitialiseTexture() {
|
||||
Debug.Log("Reinitialising spectrum texture...");
|
||||
_material = gameObject.GetComponent<Renderer>().material;
|
||||
_texture = new Texture2D(source.SpectrumSize, 1, TextureFormat.RFloat, false);
|
||||
_colorCache = new Color[source.SpectrumSize];
|
||||
_texture.name = $"AudioSpectrumData{source.SpectrumSize}";
|
||||
}
|
||||
|
||||
private float[] GetSpectrumData() {
|
||||
// Get raw / unmodified spectrum data
|
||||
var spectrumData = source.GetSpectrumData();
|
||||
|
||||
// Run spectrum data through all configured transformers
|
||||
if (Transformers != null && Transformers.Count > 0) {
|
||||
foreach (var transformer in Transformers) {
|
||||
spectrumData = transformer.Transform(spectrumData);
|
||||
}
|
||||
}
|
||||
|
||||
Preview.Values = spectrumData;
|
||||
|
||||
return spectrumData;
|
||||
}
|
||||
|
||||
private void UpdateTexture() {
|
||||
// init
|
||||
if (_texture == null) InitialiseTexture();
|
||||
|
||||
var spectrumData = GetSpectrumData();
|
||||
|
||||
for (int i = 0; i < source.SpectrumSize; i++) {
|
||||
_colorCache[i] = new Color(spectrumData[i], 0, 0, 0);
|
||||
}
|
||||
|
||||
_texture.SetPixels(_colorCache);
|
||||
_texture.Apply();
|
||||
}
|
||||
|
||||
public void UpdateBinding() {
|
||||
UpdateTexture();
|
||||
|
||||
// !!!!
|
||||
// you must set these via a literal string for some raeson
|
||||
// having them as a public property didn't work
|
||||
_material.SetFloat("_SpectrumSize", source.SpectrumSize);
|
||||
_material.SetTexture("_SpectrumDataTexture", _texture);
|
||||
_material.SetColor("_ThemeStart", preferences.Theme().Evaluate(0.0f));
|
||||
_material.SetColor("_ThemeEnd", preferences.Theme().Evaluate(0.0f));
|
||||
}
|
||||
|
||||
public string ToString() {
|
||||
return "Spectrum Material Binder";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1b37b0bbf52347f4ea1cba5897c831d5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,88 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using Assets.WasapiAudio.Scripts.Unity;
|
||||
|
||||
// only slightly different from the SpectrumMaterialBinder
|
||||
// in that it modifies a single material for a shader
|
||||
// instead of the renderer's instance of that material
|
||||
|
||||
[RequireComponent(typeof(Material))]
|
||||
public class SpectrumShaderBinder : MonoBehaviour
|
||||
{
|
||||
public WasapiAudioSource source;
|
||||
public Material material;
|
||||
|
||||
private Texture2D _texture;
|
||||
private Color[] _colorCache;
|
||||
|
||||
[SerializeReference]
|
||||
[SerializeReferenceButton]
|
||||
public List<SpectrumTransformer> Transformers = new List<SpectrumTransformer>();
|
||||
|
||||
[SpectrumDataPreview]
|
||||
public SpectrumData Preview;
|
||||
|
||||
private void Start() {
|
||||
if (source == null) {
|
||||
Debug.Log("Material Binder needs WASAPI Source.");
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void Update() {
|
||||
UpdateTexture();
|
||||
UpdateBinding();
|
||||
}
|
||||
|
||||
private void InitialiseTexture() {
|
||||
Debug.Log("Reinitialising spectrum texture...");
|
||||
_texture = new Texture2D(source.SpectrumSize, 1, TextureFormat.RFloat, false);
|
||||
_colorCache = new Color[source.SpectrumSize];
|
||||
_texture.name = $"AudioSpectrum{source.SpectrumSize}";
|
||||
}
|
||||
|
||||
private float[] GetSpectrumData() {
|
||||
// Get raw / unmodified spectrum data
|
||||
var spectrumData = source.GetSpectrumData();
|
||||
|
||||
// Run spectrum data through all configured transformers
|
||||
if (Transformers != null && Transformers.Count > 0) {
|
||||
foreach (var transformer in Transformers) {
|
||||
spectrumData = transformer.Transform(spectrumData);
|
||||
}
|
||||
}
|
||||
|
||||
Preview.Values = spectrumData;
|
||||
|
||||
return spectrumData;
|
||||
}
|
||||
|
||||
private void UpdateTexture() {
|
||||
// init
|
||||
if (_texture == null) InitialiseTexture();
|
||||
|
||||
var spectrumData = GetSpectrumData();
|
||||
|
||||
for (int i = 0; i < source.SpectrumSize; i++) {
|
||||
_colorCache[i] = new Color(spectrumData[i], 0, 0, 0);
|
||||
}
|
||||
|
||||
_texture.SetPixels(_colorCache);
|
||||
_texture.wrapMode = TextureWrapMode.Clamp;
|
||||
_texture.Apply();
|
||||
}
|
||||
|
||||
public void UpdateBinding() {
|
||||
UpdateTexture();
|
||||
|
||||
// !!!!
|
||||
// you must set these via a literal string for some raeson
|
||||
// having them as a public property didn't work
|
||||
material.SetFloat("_SpectrumSize", source.SpectrumSize);
|
||||
material.SetTexture("_SpectrumTexture", _texture);
|
||||
}
|
||||
|
||||
public string ToString() {
|
||||
return "Spectrum Material Binder";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 957c1af5e7f10154487ed1389b1086e2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,26 @@
|
||||
using UnityEngine;
|
||||
|
||||
[RequireComponent(typeof(Light))]
|
||||
public class ThemeLightBinder : MonoBehaviour
|
||||
{
|
||||
public Preferences preferences;
|
||||
public float themeTime = 0.25f;
|
||||
private Light _light;
|
||||
|
||||
private void Start() {
|
||||
_light = gameObject.GetComponent<Light>();
|
||||
|
||||
if (preferences == null) {
|
||||
Debug.Log("Light Binder needs Preferences.");
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void Update() {
|
||||
_light.color = preferences.Theme().Evaluate(themeTime);
|
||||
}
|
||||
|
||||
public string ToString() {
|
||||
return "Theme Light Binder";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e033fa8fe501cfa47a7cc7ed3296a22c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,71 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using Assets.WasapiAudio.Scripts.Unity;
|
||||
|
||||
[RequireComponent(typeof(Material))]
|
||||
public class ThemeShaderBinder : MonoBehaviour
|
||||
{
|
||||
public Material material;
|
||||
public Preferences preferences;
|
||||
|
||||
private Texture2D _texture;
|
||||
private Color[] _colorCache;
|
||||
private int textureSize = 128;
|
||||
private Gradient _theme;
|
||||
|
||||
private void Start() {
|
||||
if (preferences == null) {
|
||||
Debug.Log("Theme Shader Binder needs Preferences.");
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void Update() {
|
||||
UpdateTexture();
|
||||
UpdateBinding();
|
||||
}
|
||||
|
||||
public Color DecomposeHdrColor(Color linearColorHdr) {
|
||||
var maxColorComponent = linearColorHdr.maxColorComponent;
|
||||
float scaleFactor = 191f / maxColorComponent;
|
||||
float exposure = Mathf.Log(255f / scaleFactor) / Mathf.Log(2f);
|
||||
float factor = 1f / exposure;
|
||||
|
||||
if (exposure <= 1f) {
|
||||
return linearColorHdr;
|
||||
}
|
||||
|
||||
float r = linearColorHdr.r * factor;
|
||||
float g = linearColorHdr.g * factor;
|
||||
float b = linearColorHdr.b * factor;
|
||||
|
||||
return new Color(r, g, b, linearColorHdr.a);
|
||||
}
|
||||
|
||||
private void UpdateTexture() {
|
||||
if (_theme == preferences.Theme()) return;
|
||||
|
||||
Debug.Log("Reinitialising Theme texture...");
|
||||
_texture = new Texture2D(textureSize, 1);
|
||||
_theme = preferences.Theme();
|
||||
_colorCache = new Color[textureSize];
|
||||
_texture.name = $"ThemeTexture{textureSize}";
|
||||
_texture.wrapMode = TextureWrapMode.Clamp;
|
||||
|
||||
for (int i = 0; i < textureSize; i++) {
|
||||
if (_theme == null) return;
|
||||
Color color = DecomposeHdrColor(_theme.Evaluate((float)i / (float)textureSize));
|
||||
// Color color = _theme.Evaluate((float)i / (float)textureSize);
|
||||
_colorCache[i] = color;
|
||||
}
|
||||
|
||||
_texture.SetPixels(_colorCache);
|
||||
_texture.Apply();
|
||||
}
|
||||
|
||||
public void UpdateBinding() {
|
||||
UpdateTexture();
|
||||
material.SetFloat("_ThemeSize", textureSize);
|
||||
material.SetTexture("_ThemeTexture", _texture);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ae68405d5c7c9594ebcd0922c0389f8f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,72 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.VFX;
|
||||
using UnityEngine.VFX.Utility;
|
||||
using Assets.WasapiAudio.Scripts.Unity;
|
||||
|
||||
[AddComponentMenu("VFX/Property Binders/Kaiju/VFX Spectrum Binder")]
|
||||
[VFXBinder("Kaiju/VFX Spectrum Binder")]
|
||||
public class VfxSpectrumBinder : VfxAudioVisualizationEffect {
|
||||
[VFXPropertyBinding("System.UInt32"), SerializeField]
|
||||
protected ExposedProperty SpectrumSizeParameter = "SpectrumSize";
|
||||
|
||||
[VFXPropertyBinding("UnityEngine.Texture2D"), SerializeField]
|
||||
protected ExposedProperty SpectrumDataTextureParameter = "SpectrumDataTexture";
|
||||
|
||||
public bool symmetric = false;
|
||||
|
||||
private Texture2D _texture;
|
||||
private Color[] _colorCache;
|
||||
|
||||
private void InitialiseTexture() {
|
||||
Debug.Log("Reinitialising spectrum texture...");
|
||||
if (symmetric) {
|
||||
_texture = new Texture2D(SpectrumSize * 2, 1, TextureFormat.RFloat, false);
|
||||
_colorCache = new Color[SpectrumSize * 2];
|
||||
} else {
|
||||
_texture = new Texture2D(SpectrumSize, 1, TextureFormat.RFloat, false);
|
||||
_colorCache = new Color[SpectrumSize];
|
||||
}
|
||||
|
||||
_texture.name = $"AudioSpectrumData{SpectrumSize}";
|
||||
}
|
||||
|
||||
private void UpdateTexture() {
|
||||
// init
|
||||
if (_texture == null) InitialiseTexture();
|
||||
|
||||
// has symmetric been toggled and the texture needs updating?
|
||||
if (symmetric && _texture.width != SpectrumSize * 2) InitialiseTexture();
|
||||
if (!symmetric && _texture.width != SpectrumSize) InitialiseTexture();
|
||||
|
||||
var spectrumData = GetSpectrumData();
|
||||
|
||||
if (symmetric) {
|
||||
for (int i = 0; i < SpectrumSize; i++) {
|
||||
_colorCache[SpectrumSize + i] = new Color(spectrumData[i], 0, 0, 0);
|
||||
_colorCache[SpectrumSize - (i + 1)] = new Color(spectrumData[i], 0, 0, 0);
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < SpectrumSize; i++) {
|
||||
_colorCache[i] = new Color(spectrumData[i], 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
_texture.SetPixels(_colorCache);
|
||||
_texture.Apply();
|
||||
}
|
||||
|
||||
public override void UpdateBinding(VisualEffect component) {
|
||||
base.UpdateBinding(component);
|
||||
UpdateTexture();
|
||||
if (symmetric) {
|
||||
component.SetUInt(SpectrumSizeParameter, (uint) SpectrumSize * 2);
|
||||
} else {
|
||||
component.SetUInt(SpectrumSizeParameter, (uint) SpectrumSize);
|
||||
}
|
||||
component.SetTexture(SpectrumDataTextureParameter, _texture);
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return "Audio Spectrum Data";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6dd81208ee44c0a4ea1f1682290e1979
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in new issue
Block a user