Set Surface Effector 2D Use Bounce#
Physics 2D / Effectors / Surface Effector 2D / Set Surface Effector 2D Use Bounce
Description#
Sets the Use Bounce property of Surface Effector 2D component
Parameters#
| Name | Description |
|---|---|
| Surface Effector 2D | |
| Value |
Code#
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Title("Set Surface Effector 2D Use Bounce")]
[Category("Physics 2D/Effectors/Surface Effector 2D/Use Bounce")]
[Description("Sets the Use Bounce property of Surface Effector 2D component")]
[Image(typeof(IconSurfaceEffector), ColorTheme.Type.Lime, typeof(Badge2D))]
[Keywords("Physics, 2D")]
[Parameter("Surface Effector 2D")]
[Parameter("Value")]
[Serializable]
public class GenInstructionBool_SurfaceEffector2D_SetUseBounce : Instruction
{
[SerializeField] private GetGameObject m_SurfaceEffector2D = new GetGameObject(
new GenTypeGameObject_SurfaceEffector2D()
);
[SerializeField] private GetBool m_Value = new GetBool();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Use Bounce");
return $"{this.m_SurfaceEffector2D} {member} = {this.m_Value}";
}
protected override Awaitable Run(Args args)
{
SurfaceEffector2D component = this.m_SurfaceEffector2D.Get<SurfaceEffector2D>(args);
if (component == null) return Done;
component.useBounce = (bool) this.m_Value.Get(args);
return Done;
}
}
}