// Copyright (c) 2015 - 2023 Doozy Entertainment. All Rights Reserved. // This code can only be used under the standard Unity Asset Store End User License Agreement // A Copy of the EULA APPENDIX 1 is available at http://unity3d.com/company/legal/as_terms using System; using UnityEngine; namespace Doozy.Runtime.Common { [Serializable] public abstract class PrefabLink : ScriptableObject { /// Name of the prefab [SerializeField] private string PrefabName; /// Name of the prefab public string prefabName { get => PrefabName; protected set => PrefabName = value; } /// The prefab reference [SerializeField] private GameObject Prefab; /// The prefab reference public GameObject prefab { get => Prefab; protected set => Prefab = value; } /// TRUE if the prefab reference is not null public bool hasPrefab => prefab != null; /// TRUE if the prefabName is not null or empty public bool hasPrefabName => !string.IsNullOrEmpty(prefabName); protected PrefabLink(GameObject prefab, string prefabName = null) { Prefab = prefab; PrefabName = prefabName; } public abstract void Validate(); } }