您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

28 行
1.1 KiB

using System.Collections;
using System.Collections.Generic;
using UnityEngine.Experimental.VFX;
using UnityEngine.Experimental.VFX.Utility;
[VFXBinder("VFX Volume Mixer/Float Property Binder")]
public class VFXVolumeMixerFloatPropertyBinder : VFXVolumeMixerPropertyBinderBase
{
[VFXVolumeMixerProperty(VFXVolumeMixerPropertyAttribute.PropertyType.Float)]
public int FloatMixerProperty = 0;
[VFXParameterBinding("System.Single")]
public ExposedParameter FloatParameter = "Parameter";
public override bool IsValid(VisualEffect component)
{
return base.IsValid(component) && FloatMixerProperty < 8 && FloatMixerProperty >= 0 && computedTransform != null && component.HasFloat(FloatParameter);
}
public override void UpdateBinding(VisualEffect component)
{
component.SetFloat(FloatParameter, VFXVolumeMixer.GetFloatValueAt(FloatMixerProperty, computedTransform, Layer));
}
public override string ToString()
{
return "VFXVolumeMixer Float #" + FloatMixerProperty + " : " + FloatParameter.ToString() + " " + base.ToString();
}
}