You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
703 B
28 lines
703 B
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace UltraCombos
|
|
{
|
|
public class UniformBlendedStructuredBuffer : UniformStructuredBuffer
|
|
{
|
|
public ScriptableObject subUniform;
|
|
[Range(0, 1)]
|
|
public float rate;
|
|
|
|
protected override void FixedUpdate()
|
|
{
|
|
var data = GetData(uniform);
|
|
var sub_data = GetData(subUniform);
|
|
|
|
float v = Mathf.Clamp01(rate);
|
|
var res = new List<float>();
|
|
for (int i = 0; i < data.Count; i++)
|
|
{
|
|
res.Add(Mathf.Lerp(data[i], sub_data[i], v));
|
|
}
|
|
SetData(res);
|
|
}
|
|
}
|
|
}
|
|
|
|
|