2021-04-15 04:25:22 +01:00
|
|
|
using System;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
public class TractorBeam : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
public ParticleSystem ParticleSystem;
|
|
|
|
|
public float Radius;
|
|
|
|
|
public float Traction;
|
|
|
|
|
public float Distance;
|
|
|
|
|
|
|
|
|
|
public float Power { get; set; }
|
|
|
|
|
public Vector3 Direction { get; set; }
|
|
|
|
|
|
|
|
|
|
public void Update()
|
|
|
|
|
{
|
|
|
|
|
transform.rotation = Quaternion.LookRotation(Direction);
|
|
|
|
|
var emission = ParticleSystem.emission;
|
2026-06-21 09:37:54 +01:00
|
|
|
emission.rateOverTimeMultiplier = Power > .01f ? Power : 0;
|
2021-04-15 04:25:22 +01:00
|
|
|
}
|
2026-06-21 09:37:54 +01:00
|
|
|
}
|