Rigidbody Add Explosion Force#
Physics 3D / Rigidbody / Rigidbody Add Explosion Force ExplosionForce, ExplosionPosition, ExplosionRadius, UpwardsModifier, Mode
Description#
Executes the Add Explosion Force method on the Rigidbody component
Parameters#
| Name | Description |
|---|---|
| Explosion Force | |
| Explosion Position | |
| Explosion Radius | |
| Upwards Modifier | |
| Mode |
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("Rigidbody Add Explosion Force")]
[Category("Physics 3D/Rigidbody/Add Explosion Force", "ExplosionForce, ExplosionPosition, ExplosionRadius, UpwardsModifier, Mode")]
[Description("Executes the Add Explosion Force method on the Rigidbody component")]
[Image(typeof(IconPhysics), ColorTheme.Type.Lime)]
[Keywords("Physics, 3D")]
[Parameter("Explosion Force")]
[Parameter("Explosion Position")]
[Parameter("Explosion Radius")]
[Parameter("Upwards Modifier")]
[Parameter("Mode")]
[Serializable]
public class GenInstructionRigidbody_AddExplosionForce_5_FloatExplosionForce_Vector3ExplosionPosition_FloatExplosionRadius_FloatUpwardsModifier_ForceModeMode : Instruction
{
[SerializeField] private GetGameObject m_Rigidbody = new GetGameObject(
new GenTypeGameObject_Rigidbody()
);
[SerializeField] private GetNumber m_ExplosionForce = new GetNumber();
[SerializeField] private GetVector3 m_ExplosionPosition = new GetVector3();
[SerializeField] private GetNumber m_ExplosionRadius = new GetNumber();
[SerializeField] private GetNumber m_UpwardsModifier = new GetNumber();
[SerializeField] private ForceMode m_Mode = default;
protected override string GetTitle(GameObject source)
{
string method = TextUtils.ThemeAsKeyword("Add Explosion Force");
return $"{this.m_Rigidbody} {method} ({this.m_ExplosionForce}, {this.m_ExplosionPosition}, {this.m_ExplosionRadius}, {this.m_UpwardsModifier}, {this.m_Mode})";
}
protected override Awaitable Run(Args args)
{
Rigidbody component = this.m_Rigidbody.Get<Rigidbody>(args);
if (component == null) return Done;
component.AddExplosionForce(
(float) this.m_ExplosionForce.Get(args),
(Vector3) this.m_ExplosionPosition.Get(args),
(float) this.m_ExplosionRadius.Get(args),
(float) this.m_UpwardsModifier.Get(args),
this.m_Mode
);
return Done;
}
}
}