2020-04-16 03:08:18 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using Unity.Mathematics;
|
|
|
|
|
|
using static Unity.Mathematics.math;
|
|
|
|
|
|
using float2 = Unity.Mathematics.float2;
|
|
|
|
|
|
|
|
|
|
|
|
public class OrbitalEntity : Entity
|
|
|
|
|
|
{
|
2020-05-10 00:16:33 +01:00
|
|
|
|
public Guid OrbitData;
|
2020-04-16 03:08:18 +01:00
|
|
|
|
|
2020-11-27 22:47:33 +00:00
|
|
|
|
public OrbitalEntity(GameContext context, Guid hull, IEnumerable<Guid> gear, IEnumerable<Guid> cargo, Guid orbit, Zone zone, Guid corporation) : base(context, hull, gear, cargo, zone, corporation)
|
2020-04-16 03:08:18 +01:00
|
|
|
|
{
|
2020-05-10 00:16:33 +01:00
|
|
|
|
OrbitData = orbit;
|
2020-04-16 03:08:18 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void Update(float delta)
|
|
|
|
|
|
{
|
2020-05-10 00:16:33 +01:00
|
|
|
|
if (OrbitData != Guid.Empty)
|
|
|
|
|
|
{
|
2020-11-27 22:47:33 +00:00
|
|
|
|
Position = Zone.GetOrbitPosition(OrbitData);
|
|
|
|
|
|
Velocity = Zone.GetOrbitVelocity(OrbitData);
|
2020-05-10 00:16:33 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-04-16 03:08:18 +01:00
|
|
|
|
base.Update(delta);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|