Custom Collider 2D Custom Shape Count#
Physics 2D / Collider 2D / Custom Collider 2D / Custom Collider 2D Custom Shape Count
Can Read
Cannot Write
Description#
The Custom Shape Count property of the Custom Collider 2D 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]
[Title("Custom Collider 2D Custom Shape Count")]
[Category("Physics 2D/Collider 2D/Custom Collider 2D/Custom Shape Count")]
[Description("The Custom Shape Count property of the Custom Collider 2D component")]
[Image(typeof(IconTool), ColorTheme.Type.Lime, typeof(Badge2D))]
[Keywords("Physics, 2D")]
[Serializable]
public class GenTypeInteger_CustomCollider2D_CustomShapeCount : TypeNumber
{
[SerializeField] private GetGameObject m_CustomCollider2D = new GetGameObject(
new GenTypeGameObject_CustomCollider2D()
);
public override double GetPreview(GameObject source)
{
GameObject instance = this.m_CustomCollider2D.GetPreview(source);
if (instance == null) return default;
CustomCollider2D component = instance.GetComponent<CustomCollider2D>();
return component != null ? component.customShapeCount : default;
}
public override double Get(Args args)
{
CustomCollider2D instance = this.m_CustomCollider2D.Get<CustomCollider2D>(args);
return instance != null
? instance.customShapeCount
: default;
}
public override string ToString()
{
return $"{this.m_CustomCollider2D} Custom Shape Count";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}