2020-12-22 03:13:43 +00:00
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
|
|
|
|
using System;
|
2020-04-16 03:08:18 +01:00
|
|
|
|
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-12-10 23:20:38 +00:00
|
|
|
|
public OrbitalEntity(ItemManager itemManager, Zone zone, EquippableItem hull, Guid orbit) : base(itemManager, zone, hull)
|
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)
|
|
|
|
|
|
{
|
2021-01-06 14:56:39 +00:00
|
|
|
|
Position.xz = Zone.GetOrbitPosition(OrbitData);
|
2020-11-27 22:47:33 +00:00
|
|
|
|
Velocity = Zone.GetOrbitVelocity(OrbitData);
|
2020-05-10 00:16:33 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-04-16 03:08:18 +01:00
|
|
|
|
base.Update(delta);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|