Created TurretController, which performs basic combat for fixed orbital installations Projectiles self-destruct at maximum range Created turret prefab Outfitted turret in game manager Entity position is now 3D Entities responsible for updating their own position and orientation Barrel positions and orientations available from entity code Inventory code will display modal dialog for invalid item moves instead of breaking Yaw articulation working (full 360 rotation still borked)
31 lines
894 B
C#
31 lines
894 B
C#
/* 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;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Unity.Mathematics;
|
|
using static Unity.Mathematics.math;
|
|
using float2 = Unity.Mathematics.float2;
|
|
|
|
public class OrbitalEntity : Entity
|
|
{
|
|
public Guid OrbitData;
|
|
|
|
public OrbitalEntity(ItemManager itemManager, Zone zone, EquippableItem hull, Guid orbit) : base(itemManager, zone, hull)
|
|
{
|
|
OrbitData = orbit;
|
|
}
|
|
|
|
public override void Update(float delta)
|
|
{
|
|
if (OrbitData != Guid.Empty)
|
|
{
|
|
Position.xz = Zone.GetOrbitPosition(OrbitData);
|
|
Velocity = Zone.GetOrbitVelocity(OrbitData);
|
|
}
|
|
|
|
base.Update(delta);
|
|
}
|
|
}
|