using System; using UnityEngine; using Framework.Support; namespace Framework.Services { /// Optional base class for services that access a settings element public class Service : ScriptComponent { /// Retrieves the game object in which the settings are stored protected GameObject Settings { get { if(GameObjectHelper.IsNullOrDestroyed(this.settingsGameObject)) { this.settingsGameObject = SettingsContainer.Get(gameObject.name); } return this.settingsGameObject; } } /// Game object in which the settings are stored private GameObject settingsGameObject; } } // namespace Framework.Services