initial commit
This commit is contained in:
parent
6715289efe
commit
788c3389af
37645 changed files with 2526849 additions and 80 deletions
|
@ -0,0 +1,63 @@
|
|||
using System;
|
||||
using System.Text;
|
||||
using UnityEditor.Graphing;
|
||||
using UnityEditor.ShaderGraph.Drawing.Controls;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityEditor.ShaderGraph.Internal
|
||||
{
|
||||
[Serializable]
|
||||
[FormerName("UnityEditor.ShaderGraph.BooleanShaderProperty")]
|
||||
[BlackboardInputInfo(20)]
|
||||
public sealed class BooleanShaderProperty : AbstractShaderProperty<bool>
|
||||
{
|
||||
internal BooleanShaderProperty()
|
||||
{
|
||||
displayName = "Boolean";
|
||||
}
|
||||
|
||||
public override PropertyType propertyType => PropertyType.Boolean;
|
||||
|
||||
internal override bool isExposable => true;
|
||||
internal override bool isRenamable => true;
|
||||
|
||||
internal override string GetPropertyAsArgumentString(string precisionString)
|
||||
{
|
||||
return $"{concreteShaderValueType.ToShaderString(precisionString)} {referenceName}";
|
||||
}
|
||||
|
||||
internal override void ForeachHLSLProperty(Action<HLSLProperty> action)
|
||||
{
|
||||
HLSLDeclaration decl = GetDefaultHLSLDeclaration();
|
||||
action(new HLSLProperty(HLSLType._float, referenceName, decl, concretePrecision));
|
||||
}
|
||||
|
||||
internal override string GetPropertyBlockString()
|
||||
{
|
||||
return $"{hideTagString}[ToggleUI]{referenceName}(\"{displayName}\", Float) = {(value == true ? 1 : 0)}";
|
||||
}
|
||||
|
||||
internal override AbstractMaterialNode ToConcreteNode()
|
||||
{
|
||||
return new BooleanNode { value = new ToggleData(value) };
|
||||
}
|
||||
|
||||
internal override PreviewProperty GetPreviewMaterialProperty()
|
||||
{
|
||||
return new PreviewProperty(propertyType)
|
||||
{
|
||||
name = referenceName,
|
||||
booleanValue = value
|
||||
};
|
||||
}
|
||||
|
||||
internal override ShaderInput Copy()
|
||||
{
|
||||
return new BooleanShaderProperty()
|
||||
{
|
||||
displayName = displayName,
|
||||
value = value,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue