-
-
Save nicloay/3a24f8fe16a7794bb80b06b99ef9fd38 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using UnityEngine; | |
namespace PaintCraft.Canvas.Configs | |
{ | |
[CreateAssetMenu(fileName = "FullPageConfig", menuName = "PaintCraft/FullPageConfig")] | |
public class FullPageConfigSO : ScriptableObject, IPageConfig, ISaveUserChanges, ISaveUserIcon, IOutlineTexture, | |
IRegionTexture, IDefaultIcon, IStartTexture, IDownloadIconAsync, IDownloadDataAsync | |
{ | |
[SerializeField] private string streamingAssetPath; | |
[SerializeField] private int version; | |
private FullPageConfig fullPageConfig; | |
private FullPageConfig FullPageConfig => | |
fullPageConfig ?? (fullPageConfig = | |
new FullPageConfig(new FullPageConfigPathInfo(new PagePath(streamingAssetPath, version)))); | |
public Texture DefaultIcon => FullPageConfig.DefaultIcon; | |
public IEnumerator DownloadData() => FullPageConfig.DownloadData(); | |
public IEnumerator DownloadIcon() => FullPageConfig.DownloadIcon(); | |
public Texture OutlineTexture => FullPageConfig.OutlineTexture; | |
public void Dispose() | |
{ | |
fullPageConfig.Dispose(); | |
fullPageConfig = null; | |
} | |
public Vector2Int Size => FullPageConfig.Size; | |
public Texture2D RegionTexture => FullPageConfig.RegionTexture; | |
public Texture LoadUserChanges() => FullPageConfig.LoadUserChanges(); | |
public void SaveUserChanges(RenderTexture texture) => FullPageConfig.SaveUserChanges(texture); | |
public Vector2Int IconSize => FullPageConfig.IconSize; | |
public Texture LoadUserIcon() => FullPageConfig.LoadUserIcon(); | |
public void SaveUserIcon(RenderTexture texture) => FullPageConfig.SaveUserIcon(texture); | |
public Texture StartTexture => FullPageConfig.StartTexture; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment