Mesh Collider Convex#
Physics 3D / Collider / Mesh Collider / Mesh Collider Convex
Can Read
Can Write
Description#
The Convex property of the Mesh Collider component
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
{
[Get]
[Set]
[Title("Mesh Collider Convex")]
[Category("Physics 3D/Collider/Mesh Collider/Convex")]
[Description("The Convex property of the Mesh Collider component")]
[Image(typeof(IconMesh), ColorTheme.Type.Lime)]
[Keywords("Physics, 3D")]
[Serializable]
public class GenTypeBool_MeshCollider_Convex : TypeBool
{
[SerializeField] private GetGameObject m_MeshCollider = new GetGameObject(
new GenTypeGameObject_MeshCollider()
);
public override bool GetPreview(GameObject source)
{
GameObject instance = this.m_MeshCollider.GetPreview(source);
if (instance == null) return default;
MeshCollider component = instance.GetComponent<MeshCollider>();
return component != null ? component.convex : default;
}
public override bool Get(Args args)
{
MeshCollider instance = this.m_MeshCollider.Get<MeshCollider>(args);
return instance != null
? instance.convex
: default;
}
public override void Set(bool value, Args args)
{
MeshCollider component = this.m_MeshCollider.Get<MeshCollider>(args);
if (component != null) component.convex = (bool) value;
}
public override string ToString()
{
return $"{this.m_MeshCollider} Convex";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}