// Copyright (C) 2019-2021 Alexander Bogarsukov. All rights reserved. // See the LICENSE.md file in the project root for more information. using System; using System.Collections; using System.Collections.Generic; using System.Text; using UnityEngine; namespace UnityFx.Outline { /// /// A single outline object + its outline settings. /// public readonly struct OutlineRenderObject : IEquatable { #region data private readonly string _tag; private readonly IReadOnlyList _renderers; private readonly IOutlineSettings _outlineSettings; #endregion #region interface /// /// Gets the object tag name. /// public string Tag => _tag; /// /// Gets renderers for the object. /// public IReadOnlyList Renderers => _renderers; /// /// Gets outline settings for this object. /// public IOutlineSettings OutlineSettings => _outlineSettings; /// /// Initializes a new instance of the struct. /// public OutlineRenderObject(IReadOnlyList renderers, IOutlineSettings outlineSettings, string tag = null) { _renderers = renderers; _outlineSettings = outlineSettings; _tag = tag; } #endregion #region IEquatable /// public bool Equals(OutlineRenderObject other) { return string.CompareOrdinal(_tag, other._tag) == 0 && _renderers == other._renderers && _outlineSettings == other._outlineSettings; } #endregion } }