Cloth Collision Mass Scale#
Physics 3D / Cloth / Cloth Collision Mass Scale
Can Read
Can Write
Description#
The Collision Mass Scale property of the Cloth 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("Cloth Collision Mass Scale")]
[Category("Physics 3D/Cloth/Collision Mass Scale")]
[Description("The Collision Mass Scale property of the Cloth component")]
[Image(typeof(IconShirt), ColorTheme.Type.Lime)]
[Keywords("Physics, 3D, Kinematic")]
[Serializable]
public class GenTypeNumber_Cloth_CollisionMassScale : TypeNumber
{
[SerializeField] private GetGameObject m_Cloth = new GetGameObject(
new GenTypeGameObject_Cloth()
);
public override double GetPreview(GameObject source)
{
GameObject instance = this.m_Cloth.GetPreview(source);
if (instance == null) return default;
Cloth component = instance.GetComponent<Cloth>();
return component != null ? component.collisionMassScale : default;
}
public override double Get(Args args)
{
Cloth instance = this.m_Cloth.Get<Cloth>(args);
return instance != null
? instance.collisionMassScale
: default;
}
public override void Set(double value, Args args)
{
Cloth component = this.m_Cloth.Get<Cloth>(args);
if (component != null) component.collisionMassScale = (float) value;
}
public override string ToString()
{
return $"{this.m_Cloth} Collision Mass Scale";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}