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