rise-and-swine/Assets/Scripts/Assembly-CSharp/PartLevitation.cs
2023-02-25 23:04:03 -05:00

27 lines
494 B
C#

using System;
using UnityEngine;
public class PartLevitation : WPFMonoBehaviour
{
private void Awake()
{
this.part = base.GetComponent<BasePart>();
}
private void FixedUpdate()
{
if (base.rigidbody != null)
{
float d = (!(this.part.enclosedInto == null)) ? this.enclosedForce : this.force;
base.rigidbody.AddForce(Vector3.up * d, ForceMode.Force);
}
}
[SerializeField]
private float force;
[SerializeField]
private float enclosedForce;
private BasePart part;
}