using UnityEngine; // Sci-Fi Ship Controller. Copyright (c) 2018-2023 SCSM Pty Ltd. All rights reserved. namespace SciFiShipController { /// /// A ship docking adapter is a location on a ship that allows it to dock /// with a Ship Docking Point on a Ship Docking Station. /// A Ship Docking component can have 1 or more Docking Adapters. /// NOTE: Currently only 1 adapter per ship is permitted. This may be /// expanded in the future. /// [System.Serializable] public class ShipDockingAdapter { #region Enumerations #endregion #region Public Variables // IMPORTANT - when changing this section also update SetClassDefault() // Also update ClassName(ClassName className) Clone Constructor (if there is one) /// /// Local position relative to the Ship /// public Vector3 relativePosition; /// /// The direction the adapter is facing relative to the Ship. Default is down (y = -1). /// A +ve Z value is forwards, and -ve Z value is backwards. /// public Vector3 relativeDirection; /// /// Whether the docking adapter is shown as expanded in the inspector window of the editor. /// public bool showInEditor; /// /// Whether the docking adapter is shown as selected in the scene view of the editor. /// public bool selectedInSceneView; /// /// Whether the gizmos for this docking adapter are shown in the scene view of the editor. /// public bool showGizmosInSceneView; #endregion #region Constructors public ShipDockingAdapter() { SetClassDefaults(); } public ShipDockingAdapter(ShipDockingAdapter shipDockingAdapter) { if (shipDockingAdapter == null) { SetClassDefaults(); } else { relativePosition = shipDockingAdapter.relativePosition; relativeDirection = shipDockingAdapter.relativeDirection; } } #endregion #region Private Member Methods public void SetClassDefaults() { relativePosition = Vector3.zero; relativeDirection = Vector3.down; showInEditor = false; selectedInSceneView = false; showGizmosInSceneView = false; } #endregion } }