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-06-05 04:16:33 +01:00
|
|
|
|
public OrbitalEntity(GameContext context, Guid hull, IEnumerable<Guid> gear, IEnumerable<Guid> cargo, Guid orbit, Guid 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)
|
|
|
|
|
|
{
|
|
|
|
|
|
Position = Context.GetOrbitPosition(OrbitData);
|
2020-05-29 23:06:35 +01:00
|
|
|
|
Velocity = Context.GetOrbitVelocity(OrbitData);
|
2020-05-10 00:16:33 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-04-16 03:08:18 +01:00
|
|
|
|
base.Update(delta);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|