-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClass1.cs
More file actions
27 lines (25 loc) · 723 Bytes
/
Copy pathClass1.cs
File metadata and controls
27 lines (25 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
namespace ClassLibarary1
{
[KSPAddon(KSPAddon.Startup.Flight, false)]
public class BrrtMod : MonoBehaviour
{
public void Update()
{
double vesselSpeed = FlightGlobals.ActiveVessel.srfSpeed;
if (vesselSpeed > 0)
{
vesselSpeed /= 10;
var vessel = FlightGlobals.ActiveVessel;
var dvThing = vessel.transform.up;
dvThing *= (float)vesselSpeed;
vessel.ChangeWorldVelocity(dvThing);
}
}
}
}