Set Mesh Collider Convex#
Physics 3D / Collider / Mesh Collider / Set Mesh Collider Convex
Description#
Sets the Convex property of Mesh Collider component
Parameters#
| Name | Description |
|---|---|
| Mesh Collider | |
| 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 Mesh Collider Convex")]
[Category("Physics 3D/Collider/Mesh Collider/Convex")]
[Description("Sets the Convex property of Mesh Collider component")]
[Image(typeof(IconMesh), ColorTheme.Type.Lime)]
[Keywords("Physics, 3D")]
[Parameter("Mesh Collider")]
[Parameter("Value")]
[Serializable]
public class GenInstructionBool_MeshCollider_SetConvex : Instruction
{
[SerializeField] private GetGameObject m_MeshCollider = new GetGameObject(
new GenTypeGameObject_MeshCollider()
);
[SerializeField] private GetBool m_Value = new GetBool();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Convex");
return $"{this.m_MeshCollider} {member} = {this.m_Value}";
}
protected override Awaitable Run(Args args)
{
MeshCollider component = this.m_MeshCollider.Get<MeshCollider>(args);
if (component == null) return Done;
component.convex = (bool) this.m_Value.Get(args);
return Done;
}
}
}