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

29 行
1.1 KiB

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.VFX;
using UnityEngine.Experimental.VFX.Utility;
[VFXBinder("VFX Volume Mixer/Color Property Binder")]
public class VFXVolumeMixerColorPropertyBinder : VFXVolumeMixerPropertyBinderBase
{
[VFXVolumeMixerProperty(VFXVolumeMixerPropertyAttribute.PropertyType.Color)]
public int ColorMixerProperty = 0;
[VFXParameterBinding("UnityEngine.Color")]
public ExposedParameter ColorParameter = "Parameter";
public override bool IsValid(VisualEffect component)
{
return base.IsValid(component) && ColorMixerProperty < 8 && ColorMixerProperty >= 0 && computedTransform != null && component.HasVector4(ColorParameter);
}
public override void UpdateBinding(VisualEffect component)
{
component.SetVector4(ColorParameter, VFXVolumeMixer.GetColorValueAt(ColorMixerProperty, computedTransform, Layer));
}
public override string ToString()
{
return "VFXVolumeMixer Color #" + ColorMixerProperty + " : " + ColorParameter.ToString() + " " + base.ToString();
}
}