using UnityEngine;
// Sci-Fi Ship Controller. Copyright (c) 2018-2023 SCSM Pty Ltd. All rights reserved.
namespace SciFiShipController
{
///
/// Class containing data for a Ship Display's recticle.
/// This is the aiming device in the heads-up display
///
[System.Serializable]
public class DisplayReticle
{
#region Public variables
// IMPORTANT - when changing this section also update SetClassDefault()
// Also update ClassName(ClassName className) Clone Constructor (if there is one)
///
/// The sprite (texture) that will be displayed in the HUD
///
public Sprite primarySprite;
///
/// Whether the reticle is shown as expanded in the inspector window of the editor.
///
public bool showInEditor;
///
/// Hashed GUID code to uniquely identify a reticle.
/// [INTERNAL USE ONLY]
///
public int guidHash;
#endregion
#region Private variables
#endregion
#region Constructors
public DisplayReticle()
{
SetClassDefaults();
}
///
/// DisplayReticle copy constructor
///
///
public DisplayReticle(DisplayReticle displayReticle)
{
if (displayReticle == null) { SetClassDefaults(); }
else
{
primarySprite = displayReticle.primarySprite;
showInEditor = displayReticle.showInEditor;
guidHash = displayReticle.guidHash;
}
}
#endregion
#region Public Member Methods
///
/// Set the defaults values for this class
///
public void SetClassDefaults()
{
primarySprite = null;
showInEditor = false;
guidHash = SSCMath.GetHashCodeFromGuid();
}
#endregion
}
}