diff --git a/PvCustomizer/Editor/Resources/Icons/logo_small.png b/PvCustomizer/Editor/Resources/Icons/logo_small.png new file mode 100644 index 0000000..1b301c5 Binary files /dev/null and b/PvCustomizer/Editor/Resources/Icons/logo_small.png differ diff --git a/PvCustomizer/Editor/Resources/Icons/logo_small.png.meta b/PvCustomizer/Editor/Resources/Icons/logo_small.png.meta new file mode 100644 index 0000000..eff8120 --- /dev/null +++ b/PvCustomizer/Editor/Resources/Icons/logo_small.png.meta @@ -0,0 +1,128 @@ +fileFormatVersion: 2 +guid: c4f4279d87da7bc489cc0affcae68e48 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/PvCustomizer/Editor/Scripts/PvCustomizerSettings.cs b/PvCustomizer/Editor/Scripts/PvCustomizerSettings.cs index af1fc7d..240c781 100644 --- a/PvCustomizer/Editor/Scripts/PvCustomizerSettings.cs +++ b/PvCustomizer/Editor/Scripts/PvCustomizerSettings.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.IO; +using Akaal.Editor.Utils; using UnityEditor; using UnityEngine; @@ -12,13 +13,17 @@ public class PvCustomizerSettings : ScriptableObject, ISerializationCallbackRece public const string PackageName = "com.akaal.pvcustomizer"; - public const string k_MyCustomSettingsPath = ResourcesFolder + "PvCustomizerSettings.asset"; + private const string AssetFileName = "PvCustomizerSettings.asset"; private const string ResourcesFolder = "Assets/Plugins/PvCustomizer/Editor/Resources/"; + public const string k_MyCustomSettingsPath = ResourcesFolder + AssetFileName; #endregion #region Serializable + [SerializeField, PvIcon, HideInInspector] + private Sprite assetIcon; + [SerializeField] private float tintAmount = 0.5f; @@ -89,6 +94,8 @@ internal static PvCustomizerSettings GetOrCreateSettings() if (_settings == null) { _settings = CreateInstance(); + _settings.assetIcon = Resource.Load("Icons/logo_small.png"); + LoadDefaultRules(_settings); if (!Directory.Exists(ResourcesFolder)) Directory.CreateDirectory(ResourcesFolder); AssetDatabase.CreateAsset(_settings, k_MyCustomSettingsPath); AssetDatabase.SaveAssets(); @@ -98,6 +105,11 @@ internal static PvCustomizerSettings GetOrCreateSettings() return _settings; } + private static void LoadDefaultRules(PvCustomizerSettings settings) + { + //todo + } + internal static SerializedObject GetSerializedSettings() { return new SerializedObject(GetOrCreateSettings());