备份CatanBuilding瘦身独立工程

This commit is contained in:
JSD\13999
2026-05-26 16:15:54 +08:00
commit 2d0e6a61b7
12001 changed files with 2431925 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e39f40c41ee70b74aad08492374171a8
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,31 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEditor;
namespace HeurekaGames.Utils
{
public static class Heureka_AddDefineSymbols
{
/// <summary>
/// Add define symbols as soon as Unity gets done compiling.
/// </summary>
public static void AddDefineSymbols(string[] Symbols)
{
string definesString = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
List<string> allDefines = definesString.Split(';').ToList();
var newDefines = Symbols.Except(allDefines);
if (newDefines.Count() > 0)
{
Debug.Log($"Adding Compile Symbols {string.Join("; ", newDefines.ToArray())}");
allDefines.AddRange(newDefines);
PlayerSettings.SetScriptingDefineSymbolsForGroup(
EditorUserBuildSettings.selectedBuildTargetGroup,
string.Join(";", allDefines.ToArray()));
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 81ec5bfdbc239094e8832e7ffe32ddab
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,81 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b7cbc456ed952974280520c0443d2c9f, type: 3}
m_Name: Heureka_EditorData
m_EditorClassIdentifier:
HeadlineStyle:
m_Name: Heureka_Header
m_Normal:
m_Background: {fileID: 0}
m_ScaledBackgrounds: []
m_TextColor: {r: 1, g: 1, b: 1, a: 1}
m_Hover:
m_Background: {fileID: 0}
m_ScaledBackgrounds: []
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
m_Active:
m_Background: {fileID: 0}
m_ScaledBackgrounds: []
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
m_Focused:
m_Background: {fileID: 0}
m_ScaledBackgrounds: []
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
m_OnNormal:
m_Background: {fileID: 0}
m_ScaledBackgrounds: []
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
m_OnHover:
m_Background: {fileID: 0}
m_ScaledBackgrounds: []
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
m_OnActive:
m_Background: {fileID: 0}
m_ScaledBackgrounds: []
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
m_OnFocused:
m_Background: {fileID: 0}
m_ScaledBackgrounds: []
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
m_Border:
m_Left: 0
m_Right: 0
m_Top: 0
m_Bottom: 0
m_Margin:
m_Left: 0
m_Right: 0
m_Top: 0
m_Bottom: 0
m_Padding:
m_Left: 0
m_Right: 0
m_Top: 0
m_Bottom: 0
m_Overflow:
m_Left: 0
m_Right: 0
m_Top: 0
m_Bottom: 0
m_Font: {fileID: 12800000, guid: ef8cd11511efcac499ca79b722df7fbe, type: 3}
m_FontSize: 20
m_FontStyle: 0
m_Alignment: 0
m_WordWrap: 0
m_RichText: 1
m_TextClipping: 0
m_ImagePosition: 0
m_ContentOffset: {x: 0, y: 0}
m_FixedWidth: 0
m_FixedHeight: 0
m_StretchWidth: 1
m_StretchHeight: 0

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 84a87a1f0ff862e4fb33fbd10ecb8885
timeCreated: 1498416873
licenseType: Store
NativeFormatImporter:
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,157 @@
using System;
using UnityEditor;
using UnityEngine;
namespace HeurekaGames.Utils
{
public class Heureka_EditorData : ScriptableObject
{
public delegate void EditorDataRefreshDelegate();
public static event EditorDataRefreshDelegate OnEditorDataRefresh;
private static Heureka_EditorData m_instance;
public static Heureka_EditorData Instance
{
get
{
if (!m_instance)
{
m_instance = loadData();
}
return m_instance;
}
}
private static Heureka_EditorData loadData()
{
//LOGO ON WINDOW
string[] configData = AssetDatabase.FindAssets("EditorData t:" + typeof(Heureka_EditorData).ToString(), null);
if (configData.Length >= 1)
{
return AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(configData[0]), typeof(Heureka_EditorData)) as Heureka_EditorData;
}
Debug.LogError("Failed to find config data");
return null;
}
internal void RefreshData()
{
if (OnEditorDataRefresh != null)
OnEditorDataRefresh();
}
public GUIStyle HeadlineStyle;
public static class Links
{
private const string AffiliateID = "1011l4Izm";
private const string SlugSmartBuilder = "206777";
private const string SlugAssetHunter = "135296";
private const string SlugAssetFinder = "97772";
public static string FromAHPToSmartBuilder => GenerateLink("AHPNews", SlugSmartBuilder);
private static string GenerateLink(string pubref, string slug)
{
return $"https://prf.hn/click/camref:{AffiliateID}/pubref:{pubref}/destination:https%3A%2F%2Fassetstore.unity.com%2Fpackages%2Fslug%2F{slug}";
}
}
}
[System.Serializable]
public class ConfigurableIcon
{
[SerializeField] private bool isUsingDarkSkin = false;
[SerializeField] string buildInIconName = "";
[SerializeField] private Texture iconCached = null;
[SerializeField] Texture m_iconNormalOverride = null;
[SerializeField] Texture m_iconProSkinOverride = null;
public ConfigurableIcon()
{
Heureka_EditorData.OnEditorDataRefresh += onEditorDataRefresh;
}
private void onEditorDataRefresh()
{
iconCached = null;
}
public Texture Icon
{
get
{
//TODO A way to make sure we update, if the user have changed skin
if (isUsingDarkSkin != EditorGUIUtility.isProSkin)
{
iconCached = null;
isUsingDarkSkin = EditorGUIUtility.isProSkin;
}
return (iconCached != null) ? iconCached : (iconCached = GetInvertedForProSkin());
}
}
[SerializeField]
bool m_darkSkinInvert = false;
protected Texture GetInvertedForProSkin()
{
Texture imageToUse = (EditorGUIUtility.isProSkin) ? m_iconProSkinOverride : m_iconNormalOverride;
//If we want to use default unity icons and nothing has been setup to override
if (imageToUse == null && !string.IsNullOrEmpty(buildInIconName))
if (EditorGUIUtility.IconContent(buildInIconName) != null)
imageToUse = EditorGUIUtility.IconContent(buildInIconName).image;
//Return current image if we dont have proskin, or dont want to invert
if (!EditorGUIUtility.isProSkin || (EditorGUIUtility.isProSkin && !m_darkSkinInvert))
return imageToUse;
Texture2D readableTexture = getReadableTexture(imageToUse);
Texture2D inverted = new Texture2D(readableTexture.width, readableTexture.height, TextureFormat.ARGB32, false);
for (int x = 0; x < readableTexture.width; x++)
{
for (int y = 0; y < readableTexture.height; y++)
{
Color origColor = readableTexture.GetPixel(x, y);
Color invertedColor = new Color(1 - origColor.r, 1 - origColor.g, 1 - origColor.b, origColor.a);
inverted.SetPixel(x, y, (origColor.a > 0) ? invertedColor : origColor);
}
}
inverted.Apply();
return inverted;
}
private Texture2D getReadableTexture(Texture imageToUse)
{
// Create a temporary RenderTexture of the same size as the texture
RenderTexture tmp = RenderTexture.GetTemporary(
imageToUse.width,
imageToUse.height,
0,
RenderTextureFormat.Default,
RenderTextureReadWrite.Linear);
// Blit the pixels on texture to the RenderTexture
Graphics.Blit(imageToUse, tmp);
// Backup the currently set RenderTexture
RenderTexture previous = RenderTexture.active;
// Set the current RenderTexture to the temporary one we created
RenderTexture.active = tmp;
// Create a new readable Texture2D to copy the pixels to it
Texture2D myTexture2D = new Texture2D(imageToUse.width, imageToUse.height);
// Copy the pixels from the RenderTexture to the new Texture
myTexture2D.ReadPixels(new Rect(0, 0, tmp.width, tmp.height), 0, 0);
myTexture2D.Apply();
// Reset the active RenderTexture
RenderTexture.active = previous;
// Release the temporary RenderTexture
RenderTexture.ReleaseTemporary(tmp);
return myTexture2D;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: b7cbc456ed952974280520c0443d2c9f
timeCreated: 1498416726
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,16 @@
{
"name": "HeurekaGames.Utils",
"rootNamespace": "",
"references": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 6b3b893d46a69d5498029e96ff000779
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,102 @@
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace HeurekaGames.Utils
{
public static class Heureka_ResourceLoader
{
private static readonly Dictionary<HeurekaPackage, string> iconPaths = new Dictionary<HeurekaPackage, string>()
{
{HeurekaPackage.SHARED, "com.heurekagames.utils" },
{HeurekaPackage.AHP, "com.heurekagames.assethunterpro" },
{HeurekaPackage.SB, "com.heurekagames.smartbuilder" },
{HeurekaPackage.AFP, "com.heurekagames.assetfinderpro" }
};
public static class Content
{
public static GUIContent Previous = GetInternalContentWithTooltip("tab_prev", "Previous");
public static GUIContent Next = GetInternalContentWithTooltip("tab_next", "Next");
}
public static class Icons
{
public static Texture Pick = EditorGUIUtility.IconContent("pick").image;
public static Texture Clear = EditorGUIUtility.IconContent(Heureka_Utils.IsUnityVersionGreaterThan(2020) ? "clear" : "Toolbar Minus").image;
public static Texture Previous = EditorGUIUtility.IconContent("tab_prev").image;
public static Texture Next= EditorGUIUtility.IconContent("tab_next").image;
}
public static class IconNames
{
public static readonly string TabIconAHP = "tabIcon";
}
public enum HeurekaPackage
{
SHARED,
AHP,
SB,
AFP
}
public static string GetIconPath(HeurekaPackage package, string iconName)
{
var path = $"Packages/{iconPaths[package]}/UI/Icons/{iconName}.png";
var folder = System.IO.Directory.GetCurrentDirectory() + $"/Packages/{iconPaths[package]}/UI/Icons";
bool exists = System.IO.Directory.Exists(folder);
//If this icon resides in "packages"
if (exists)
{
return path;
}
//Else we need to find the directory it lives in
else
{
var targetDir = System.IO.Directory.GetDirectories(System.IO.Directory.GetCurrentDirectory(), $"{iconPaths[package]}", System.IO.SearchOption.AllDirectories);
if (targetDir.Length > 0)
{
var iconPath = string.Join(", ", System.IO.Directory.GetDirectories(targetDir[0], "Icons", System.IO.SearchOption.AllDirectories)) + $"/{iconName}.png";
var relativepath = "Assets" + iconPath.Substring(Application.dataPath.Length);
return relativepath;
}
}
Debug.LogWarning($"Unable to find {iconName} icon, please reinstall Heureka package: {package} in packages");
return string.Empty;
}
public static Texture GetIcon(HeurekaPackage package, string iconName)
{
return EditorGUIUtility.TrIconContent(GetIconPath(package, iconName)).image;
}
public static GUIContent GetContentWithTitle(HeurekaPackage package, string iconName, string title)
{
return EditorGUIUtility.TrTextContentWithIcon(title, GetIconPath(package, iconName));
}
public static GUIContent GetContentWithTooltip(HeurekaPackage package, string iconName, string tooltip)
{
return EditorGUIUtility.TrIconContent(GetIconPath(package, iconName), tooltip);
}
public static GUIContent GetContent(HeurekaPackage package, string iconName, string title, string tooltip)
{
return EditorGUIUtility.TrTextContentWithIcon(title, tooltip, GetIconPath(package, iconName));
}
public static GUIContent GetInternalContentWithTooltip(string iconName, string tooltip)
{
return new GUIContent(EditorGUIUtility.IconContent(iconName).image, tooltip);
}
public static Texture GetInternalIcon(string iconName)
{
return EditorGUIUtility.IconContent(iconName).image;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6096cbae469d125438eb9ff47cbc2022
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,74 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using PackageInfo = UnityEditor.PackageManager.PackageInfo;
using UnityEditor;
namespace HeurekaGames.Utils
{
public class Heureka_Serializer
{
public static string Serialize(List<string> items)
{
return JsonUtility.ToJson(new StringList(items));
}
public static List<string> DeserializeStringList(string json)
{
StringList list = JsonUtility.FromJson<StringList>(json);
return (list != null) ? list.Items : new List<string>();
}
public static Type DeSerializeType(string serializedType)
{
return Type.GetType(serializedType);
}
public static string SerializeType(Type type)
{
return type.AssemblyQualifiedName;
}
[SerializeField]
public class StringList
{
public List<string> Items = new List<string>();
public StringList(List<string> items)
{
this.Items = items;
}
}
}
public static class Heureka_Utils
{
public static PackageInfo GetPackageInfo<T>()
{
var assembly = typeof(T).Assembly;
return PackageInfo.FindForAssembly(assembly);
}
public static string GetVersionNumber<T>()
{
return GetPackageInfo<T>()?.version ?? "";
}
public static PackageInfo GetPackageInfoFromObject(UnityEngine.Object asset)
{
return PackageInfo.FindForAssetPath(AssetDatabase.GetAssetPath(asset));
}
public static string GetAssetStoreSearchLink(IEnumerable<string> tags)
{
string tracker = @"https://prf.hn/click/camref:1011l4Izm/pubref:SBSearch/destination:";
string search = string.Join(" ", tags);
return tracker + @"https://assetstore.unity.com/?category=3d%5C2d&q=" + search + @"&orderBy=1";
}
public static bool IsUnityVersionGreaterThan(int major)
{
return System.Int32.Parse(Application.unityVersion.Split('.')[0]) > major;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8cdad70aa85cb144e9299622e104cce6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,111 @@
using System;
using UnityEditor;
using UnityEngine;
namespace HeurekaGames.Utils
{
public static class Heureka_WindowStyler
{
public static float HeaderHeight { get; private set; } = 24f;
public static readonly Color clr_Pink = new Color((226f / 256f), (32f / 256f), (140f / 256f), 1);
public static readonly Color clr_Dark = new Color((48f / 256f), (41f / 256f), (47f / 256f), 1);
public static readonly Color clr_dBlue = new Color((47f / 256f), (102f / 256f), (144f / 256f), 1);
public static readonly Color clr_lBlue = new Color((58f / 256f), (124f / 256f), (165f / 256f), 1);
public static readonly Color clr_White = new Color((217f / 256f), (220f / 256f), (214f / 256f), 1);
public static readonly Color clr_Red = new Color((183f / 256f), (0f / 256f), (0f / 256f));
public static readonly Color clr_middleGreen = new Color((85f / 256f), (133f / 256f), (100f / 256f));
public static void DrawGlobalHeader(Color color, string label, string version = "", Action additionHeaderContent = null)
{
EditorGUI.DrawRect(new Rect(0, 0, EditorGUIUtility.currentViewWidth, HeaderHeight), color);
EditorGUILayout.BeginHorizontal();
GUILayout.Space(4);
if (Heureka_EditorData.Instance.HeadlineStyle != null)
GUILayout.Label(label + " ", Heureka_EditorData.Instance.HeadlineStyle, GUILayout.ExpandWidth(false));
if (version != "")
{
EditorGUILayout.BeginVertical();
EditorGUILayout.Space();
GUILayout.Label(version, EditorStyles.whiteLabel);
EditorGUILayout.EndVertical();
additionHeaderContent?.Invoke();
}
if(additionHeaderContent==null)
GUILayout.FlexibleSpace();
EditorGUILayout.EndHorizontal();
}
public static void DrawCenteredImage(EditorWindow window, Texture image)
{
if (window == null)
return;
GUI.Box(new Rect((window.position.width * .5f) - (image.width * .5f), (window.position.height * .5f) - (image.height * .5f), image.width, image.height), image, GUIStyle.none);
}
public static void DrawCenteredMessage(EditorWindow window, Texture icon, float msgWidth, float msgHeight, string messsage)
{
if (window == null)
return;
Vector2 iconSize = Vector2.zero;
if (icon != null)
iconSize = new Vector2(icon.width, icon.height);
Vector2 outerBoxSize = new Vector2(msgWidth, msgHeight);
float frameWidth = 5;
Vector2 innerBoxSize = new Vector2(outerBoxSize.x - frameWidth * 2, outerBoxSize.y - frameWidth * 2);
Vector2 rectStartPos = new Vector2((window.position.width * .5f) - (outerBoxSize.x * .5f), (window.position.height * .5f) - (outerBoxSize.y * .5f) + (iconSize.y * .5f));
EditorGUI.DrawRect(new Rect(rectStartPos.x, rectStartPos.y, outerBoxSize.x, outerBoxSize.y), Heureka_WindowStyler.clr_White);
EditorGUI.DrawRect(new Rect(rectStartPos.x + frameWidth, rectStartPos.y + frameWidth, innerBoxSize.x, innerBoxSize.y), Heureka_WindowStyler.clr_dBlue);
float bounds = 20;
Vector2 logoStartPos = rectStartPos + new Vector2(bounds, bounds);
GUI.Box(new Rect(logoStartPos.x, logoStartPos.y, iconSize.x, iconSize.y), icon, GUIStyle.none);
Vector2 labelStartPos = logoStartPos + new Vector2(iconSize.x + frameWidth * 2, 0);
float textWidth = innerBoxSize.x - iconSize.x - (bounds * 2);
float textHeight = 30;
string[] lines = messsage.Split(
new[] { Environment.NewLine },
StringSplitOptions.None
);
GUI.Label(new Rect(labelStartPos.x, labelStartPos.y, textWidth, textHeight), lines[0], Heureka_EditorData.Instance.HeadlineStyle);
var whiteStyle = new GUIStyle(EditorStyles.label);
whiteStyle.normal.textColor = Color.white;
labelStartPos.y += 20;
for (int i = 1; i < lines.Length; i++)
{
GUI.Label(new Rect(labelStartPos.x, labelStartPos.y, textWidth, textHeight), lines[i], whiteStyle);
labelStartPos.y += 16;
}
}
private static GUIStyle imageBtnStyle;
public static GUIStyle ImageBtnStyle
{
get
{
if (imageBtnStyle == null)
{
imageBtnStyle = new GUIStyle(GUI.skin.button);
imageBtnStyle.padding = new RectOffset(0, 0, 0, 0);
}
return imageBtnStyle;
}
set => imageBtnStyle = value;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 193aea51eb2e7314387c70be631287b0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 60e6e35b365f2344983f76490854e617
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,42 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
namespace HeurekaGames.Utils
{
[System.Serializable]
public class Heureka_PackageData : ScriptableObject
{
public Texture Icon;
public int PackageShowPrio;
public string AssetName;
public string Subheader;
public string AssetIdentifier;
public string Description;
public List<PackageLinks> Links = new List<PackageLinks>();
}
[System.Serializable]
public struct PackageLinks
{
public bool ActiveLink;
public string Name;
public string Link;
public PackageLinks(string Name, string Link)
{
this.Name = Name;
this.Link = Link;
this.ActiveLink = true;
}
public PackageLinks(string Name, string Link, bool LinkActive)
{
this.Name = Name;
this.Link = Link;
this.ActiveLink = LinkActive;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e2b56c743d6a700428791f460b02a9c7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace HeurekaGames.Utils
{
public class Heureka_PackageDataManager : ScriptableObject
{
public Texture2D icon;
public string title;
public List<PackageLinks> Links = new List<PackageLinks>();
public Heureka_PackageData[] sections;
public bool loadedLayout;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5ad52548211456340bc14f056dd164dd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,267 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.Linq;
using System.IO;
using System.Reflection;
using System;
namespace HeurekaGames.Utils
{
[CustomEditor(typeof(Heureka_PackageDataManager))]
[InitializeOnLoad]
public class Heureka_PackageDataManagerEditor : Editor
{
public static readonly string ShowedReadmeProjectStateName = "HeurekaGames.PackageDataManager.ShowedReadme";
static float kSpace = 16f;
static Heureka_PackageDataManagerEditor()
{
EditorApplication.delayCall += SelectReadmeAutomatically;
}
static void SelectReadmeAutomatically()
{
if (!EditorPrefs.GetBool(getUniqueReadMeStatePrefKey(), false))
{
SelectReadme();
EditorPrefs.SetBool(getUniqueReadMeStatePrefKey(), true);
}
}
private static string getUniqueReadMeStatePrefKey()
{
return ShowedReadmeProjectStateName + "." + Application.dataPath;
}
[MenuItem("Window/Heureka/Readme", priority = 10)]
public static Heureka_PackageDataManager SelectReadme()
{
var ids = AssetDatabase.FindAssets("t:" + typeof(Heureka_PackageDataManager).ToString());
if (ids.Length == 1)
{
var readmeObject = AssetDatabase.LoadMainAssetAtPath(AssetDatabase.GUIDToAssetPath(ids[0]));
Selection.objects = new UnityEngine.Object[] { readmeObject };
return (Heureka_PackageDataManager)readmeObject;
}
else
{
Debug.Log("Couldn't find a readme");
return null;
}
}
private void OnEnable()
{
readmeManager = SelectReadme();// (Heureka_PackageDataManager)target;
//populate sections
var guids = AssetDatabase.FindAssets($"t:{nameof(Heureka_PackageData).ToString()}");
List<Heureka_PackageData> tmpList = new List<Heureka_PackageData>();
foreach (var item in guids)
{
string path = AssetDatabase.GUIDToAssetPath(item);
tmpList.Add(AssetDatabase.LoadAssetAtPath<Heureka_PackageData>(path));
}
readmeManager.sections = tmpList.ToArray();
//readmeManager.sections = Resources.FindObjectsOfTypeAll<Heureka_PackageData>();
//Sorted lidt by show Priority
readmeManager.sections = readmeManager.sections.OrderByDescending(val => val.PackageShowPrio).ToArray();
List<Heureka_PackageData> listUniqueEntries = new List<Heureka_PackageData>();
foreach (var item in readmeManager.sections)
{
//If we dont have this asset identifier in list already
if (!listUniqueEntries.Any(val=>val.AssetIdentifier == item.AssetIdentifier))
listUniqueEntries.Add(item);
//If it IS in list already find the one that is NOT a promo, and put that in list
else
{
//If the one we look at right now is a promo, just ignore
if (item.GetType() == typeof(Heureka_PackageDataPromo))
continue;
else
{
//Remove the promo from list and insert the new one with similar identifier (Which should be a readme)
listUniqueEntries.Remove(listUniqueEntries.Find(val=>val.AssetIdentifier == item.AssetIdentifier));
listUniqueEntries.Add(item);
}
}
}
readmeManager.sections = listUniqueEntries.ToArray();
}
protected override void OnHeaderGUI()
{
Init();
//Make sure we have the proper readme's
SelectReadme();
var iconWidth = 96;// Mathf.Min(EditorGUIUtility.currentViewWidth / 3f - 20f, 128f);
GUILayout.BeginHorizontal();
{
GUILayout.Space(10);
EditorGUILayout.BeginVertical();
GUILayout.Space(10);
GUILayout.Label(readmeManager.icon, GUILayout.Width(iconWidth), GUILayout.Height(iconWidth));
EditorGUILayout.EndVertical();
EditorGUILayout.BeginVertical();
GUILayout.BeginHorizontal();
GUILayout.Label(readmeManager.title, TitleStyle);
GUILayout.FlexibleSpace();
GUILayout.EndHorizontal();
foreach (var link in readmeManager.Links.Where(val => val.ActiveLink == true))
{
if (LinkLabel(new GUIContent(link.Name)))
{
Application.OpenURL(link.Link);
}
}
EditorGUILayout.EndVertical();
}
GUILayout.EndHorizontal();
}
public override void OnInspectorGUI()
{
GUILayout.Space(20);
Init();
foreach (var section in readmeManager.sections)
{
drawSeparator();
if (!string.IsNullOrEmpty(section.AssetName))
{
EditorGUILayout.BeginHorizontal();
GUILayout.Box(section.Icon, GUIStyle.none, GUILayout.Width(64), GUILayout.Height(64));
EditorGUILayout.BeginVertical();
GUILayout.Label(section.AssetName, TitleStyle);
GUILayout.Label(section.Subheader, HeadingStyle);
EditorGUILayout.EndVertical();
EditorGUILayout.EndHorizontal();
GUILayout.Space(kSpace);
}
if (!string.IsNullOrEmpty(section.Description))
{
GUILayout.Label(section.Description, BodyStyle);
}
if (section.Links != null)
{
foreach (var link in section.Links.Where(val => val.ActiveLink == true))
{
if (LinkLabel(new GUIContent(link.Name)))
{
Application.OpenURL(link.Link);
}
}
}
GUILayout.Space(10);
//If this is a versioned data package
if (section.GetType() == typeof(Heureka_PackageDataVersioned))
{
Heureka_PackageDataVersioned versionedSection = (Heureka_PackageDataVersioned)section;
if (versionedSection.VersionData != null && versionedSection.VersionData.Count > 0)
{
versionedSection.FoldOutVersionHistory = EditorGUILayout.Foldout(versionedSection.FoldOutVersionHistory, "Version History");
if (versionedSection.FoldOutVersionHistory)
{
for (int i = versionedSection.VersionData.Count() - 1; i >= 0; i--)
{
EditorGUI.indentLevel++;
{
GUILayout.Label(versionedSection.VersionData[i].VersionNum.GetVersionString(), HeadingStyle);
EditorGUI.indentLevel+=2;
foreach (var versionChange in versionedSection.VersionData[i].VersionChanges)
{
EditorGUILayout.LabelField("- " + versionChange, BodyStyle);
}
EditorGUI.indentLevel-=2;
}
EditorGUI.indentLevel--;
GUILayout.Space(4);
}
GUILayout.Space(kSpace);
}
}
}
}
}
private void drawSeparator()
{
var rect = EditorGUILayout.BeginHorizontal();
Handles.color = Color.gray;
Handles.DrawLine(new Vector2(rect.x - 15, rect.y), new Vector2(rect.width + 15, rect.y));
EditorGUILayout.EndHorizontal();
EditorGUILayout.Space();
}
bool m_Initialized;
GUIStyle LinkStyle { get { return m_LinkStyle; } }
[SerializeField] GUIStyle m_LinkStyle;
GUIStyle TitleStyle { get { return m_TitleStyle; } }
[SerializeField] GUIStyle m_TitleStyle;
GUIStyle HeadingStyle { get { return m_HeadingStyle; } }
[SerializeField] GUIStyle m_HeadingStyle;
GUIStyle BodyStyle { get { return m_BodyStyle; } }
[SerializeField] GUIStyle m_BodyStyle;
private Heureka_PackageDataManager readmeManager;
void Init()
{
if (m_Initialized)
return;
m_BodyStyle = new GUIStyle(EditorStyles.label);
m_BodyStyle.wordWrap = true;
m_BodyStyle.fontSize = 12;
m_TitleStyle = new GUIStyle(m_BodyStyle);
m_TitleStyle.wordWrap = false;
m_TitleStyle.fontSize = 18;
m_HeadingStyle = new GUIStyle(m_BodyStyle);
m_HeadingStyle.wordWrap = false;
m_HeadingStyle.fontSize = 14;
m_LinkStyle = new GUIStyle(m_BodyStyle);
m_LinkStyle.wordWrap = false;
// Match selection color which works nicely for both light and dark skins
m_LinkStyle.normal.textColor = new Color(0x00 / 255f, 0x78 / 255f, 0xDA / 255f, 1f);
m_LinkStyle.stretchWidth = false;
m_Initialized = true;
}
bool LinkLabel(GUIContent label, params GUILayoutOption[] options)
{
var position = GUILayoutUtility.GetRect(label, LinkStyle, options);
Handles.BeginGUI();
Handles.color = LinkStyle.normal.textColor;
Handles.DrawLine(new Vector3(position.xMin, position.yMax), new Vector3(position.xMax, position.yMax));
Handles.color = Color.white;
Handles.EndGUI();
EditorGUIUtility.AddCursorRect(position, MouseCursor.Link);
return GUI.Button(position, label, LinkStyle);
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: a00647402484491499b5fb701efabe22
timeCreated: 1484146680
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
namespace HeurekaGames.Utils
{
public class Heureka_PackageDataPromo : Heureka_PackageData
{
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 312ef3862be95544daf14a84810fef28
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,196 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
namespace HeurekaGames.Utils
{
public class Heureka_PackageDataVersioned : Heureka_PackageData
{
public List<PackageVersion> VersionData = new List<PackageVersion>();
internal bool FoldOutVersionHistory;
private void Item_OnChanged()
{
EditorUtility.SetDirty(this);
}
public void AddNewVersion(int major, int minor, int patch)
{
PackageVersion newPackageVersion = new PackageVersion(major, minor, patch);
VersionData.Add(newPackageVersion);
}
public void CollapseAll()
{
foreach (var item in VersionData)
{
item.FoldOut = false;
}
}
public void Delete(PackageVersion target)
{
VersionData.Remove(target);
}
}
[System.Serializable]
public class PackageVersion
{
[SerializeField] public PackageVersionNum VersionNum = new PackageVersionNum();
[SerializeField] public List<string> VersionChanges = new List<string>();
internal bool FoldOut = false;
PackageVersionNum newVersionNum = new PackageVersionNum();
private const float btnWidth = 150;
private ReorderableList reorderableList;
private bool initialized = false;
public PackageVersion(int major, int minor, int patch)
{
this.VersionNum = newVersionNum = new PackageVersionNum(major, minor, patch);
this.FoldOut = true;
}
private void initialize()
{
initialized = true;
reorderableList = new ReorderableList(VersionChanges, typeof(string), true, true, true, true);
reorderableList.drawHeaderCallback += DrawHeader;
reorderableList.drawElementCallback += DrawElement;
reorderableList.onAddCallback += AddItem;
reorderableList.onRemoveCallback += RemoveItem;
}
/// <summary>
/// Draws the header of the list
/// </summary>
/// <param name="rect"></param>
private void DrawHeader(Rect rect)
{
GUI.Label(rect, "Version changes");
}
/// <summary>
/// Draws one element of the list (ListItemExample)
/// </summary>
/// <param name="rect"></param>
/// <param name="index"></param>
/// <param name="active"></param>
/// <param name="focused"></param>
private void DrawElement(Rect rect, int index, bool active, bool focused)
{
VersionChanges[index] = EditorGUI.TextField(new Rect(rect.x + 18, rect.y, rect.width - 18, rect.height), VersionChanges[index]);
}
private void AddItem(ReorderableList list)
{
VersionChanges.Add("");
}
private void RemoveItem(ReorderableList list)
{
VersionChanges.RemoveAt(list.index);
}
public void OnGUI(ref bool shouldDelete)
{
if (!initialized || reorderableList == null)
initialize();
GUILayout.Space(10);
FoldOut = EditorGUILayout.Foldout(FoldOut, VersionNum.GetVersionString());
if (GUILayout.Button("Delete Version", GUILayout.Width(btnWidth)))
shouldDelete = true;
if (FoldOut)
{
EditorGUILayout.BeginHorizontal();
if (GUILayout.Button("Update Version", GUILayout.Width(btnWidth)))
updateVersion();
//Allow for changing version num
newVersionNum.Major = EditorGUILayout.IntField(newVersionNum.Major);
newVersionNum.Minor = EditorGUILayout.IntField(newVersionNum.Minor);
newVersionNum.Patch = EditorGUILayout.IntField(newVersionNum.Patch);
EditorGUILayout.EndHorizontal();
EditorGUILayout.BeginHorizontal();
//versionDescription = GUILayout.TextArea(versionDescription);
if (reorderableList.count > 0 && (GUILayout.Button("Copy to clipboard")))
{
string clipboardString = "";
foreach (var item in reorderableList.list)
{
clipboardString += item.ToString() + Environment.NewLine;
}
EditorGUIUtility.systemCopyBuffer = clipboardString;
}
EditorGUILayout.EndHorizontal();
{
reorderableList.DoLayoutList();
}
}
}
private void updateVersion()
{
VersionNum = new PackageVersionNum(newVersionNum.Major, newVersionNum.Minor, newVersionNum.Patch);
//TODO SORT Parent list
}
}
[System.Serializable]
public struct PackageVersionNum : IComparable<PackageVersionNum>
{
[SerializeField] public int Major;
[SerializeField] public int Minor;
[SerializeField] public int Patch;
public PackageVersionNum(int major, int minor, int path)
{
this.Major = major;
this.Minor = minor;
this.Patch = path;
}
public int CompareTo(PackageVersionNum other)
{
if (this.Major != other.Major)
return this.Major.CompareTo(other.Major);
else if (this.Minor != other.Minor)
return this.Minor.CompareTo(other.Minor);
else
return this.Patch.CompareTo(other.Patch);
}
public class VersionComparer : IComparer<PackageVersionNum>
{
int IComparer<PackageVersionNum>.Compare(PackageVersionNum objA, PackageVersionNum objB)
{
return objA.CompareTo(objB);
}
}
public string GetVersionString()
{
return string.Format("{0}.{1}.{2}", Major, Minor, Patch);
}
public bool IsEmpty()
{
return (Major == 0 && Minor == 0 && Patch == 0);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7b27603d2be0e81488eb446378c435df
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 39bee0420898fb343a47d03577e24b10
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,34 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5ad52548211456340bc14f056dd164dd, type: 3}
m_Name: Heureka_Readme
m_EditorClassIdentifier:
icon: {fileID: 2800000, guid: c1a521ce2efaeeb4a89e0613e9f428dd, type: 3}
title: Heureka Games
Links:
- ActiveLink: 1
Name: Asset Store
Link: https://assetstore.unity.com/publishers/5473
- ActiveLink: 1
Name: Facebook
Link: https://www.facebook.com/HeurekaGames/
- ActiveLink: 1
Name: Twitter
Link: https://twitter.com/heurekagames
- ActiveLink: 1
Name: Youtube
Link: https://www.youtube.com/channel/UCoCeBCLtLCxHz1H3nCQzKCA/
sections:
- {fileID: 11400000, guid: 8f22d4086e946164fb32d2ca61f91090, type: 2}
- {fileID: 11400000, guid: 059cb120dafc78d4bbf6d0e96525b794, type: 2}
- {fileID: 11400000, guid: f666adb71bbbeb140b8418f505ab785f, type: 2}
loadedLayout: 0

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4bec14875ff7a2847857dae3bbac982f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 006172ea1474579448c3abc4595762fe
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,49 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 312ef3862be95544daf14a84810fef28, type: 3}
m_Name: AFPRO_Promo
m_EditorClassIdentifier:
Icon: {fileID: 2800000, guid: a14c62f6ab555b84184d54decfec1f6d, type: 3}
PackageShowPrio: 90
AssetName: Favorites PRO
Subheader: Favorites and History
AssetIdentifier: Heureka.AssetFinderPRO
Description: 'Asset Finder PRO greatly boost productivity by giving you favorites,
history and scene analysis. Easy access to all the assets you need most often.
No more lost time trying to find the things you need.
Main Features:
1:
A list of your own favorites for easy access (Both folders and individual assets)
2:
A comprehensive automatic history of all the assets you have been using recently,
which allows you to quickly locate the things you use the most.
3: A list
of all the prefabs being used in current scene. That allows you to quickly find
anything often used in a specific scene.'
Links:
- ActiveLink: 1
Name: Asset Store
Link: https://prf.hn/click/camref:1011l4Izm/pubref:Package/destination:https%3A%2F%2Fassetstore.unity.com%2Fpackages%2Fslug%2F97772
- ActiveLink: 1
Name: Documentation
Link: http://heureka.dk/wp-content/uploads/2017/08/Documentation-FavoritesPRO.pdf
- ActiveLink: 1
Name: Forum Thread
Link: https://forum.unity.com/threads/favorites-pro-favorites-history-and-scene-analysis.492380/
- ActiveLink: 1
Name: Youtube
Link: https://www.youtube.com/watch?v=pw3cJ2x1SOg

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5f7f5f4aad31e494da58427a71ff180b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,53 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 312ef3862be95544daf14a84810fef28, type: 3}
m_Name: AHPRO_Promo
m_EditorClassIdentifier:
Icon: {fileID: 2800000, guid: 931681cc0eefb7e4985cecbad117a822, type: 3}
PackageShowPrio: 1000
AssetName: Asset Hunter PRO
Subheader: Project Cleaning Tool
AssetIdentifier: Heureka.AssetHunterPRO
Description: 'Asset Hunter PRO is THE project cleaning tool of the asset store.
It will help you locate all the unused asset and delete them. It will reduce
time spend waiting for the editor to load. It also simply boosts productivity
in general by having to search through less stuff.
Its based on the learnings
from Asset Hunter 2, but its a full rewrite with new features, new UI, improved
workflow and HUGE performance gains.
Asset Hunter can also aid you in finding
those pesky assets that bloat your buildsize by giving you a sortable list of
used assets.
Also includes a reference graph and a way to find duplicate
assets'
Links:
- ActiveLink: 1
Name: Asset Store
Link: https://prf.hn/click/camref:1011l4Izm/pubref:Package/destination:https%3A%2F%2Fassetstore.unity.com%2Fpackages%2Fslug%2F135296
- ActiveLink: 1
Name: Documentation
Link: http://heureka.dk/wp-content/uploads/2018/12/Documentation-Asset-Hunter-PRO.pdf
- ActiveLink: 1
Name: Forum Thread
Link: http://forum.unity3d.com/threads/released-asset-hunter-project-cleaning.274173/
- ActiveLink: 1
Name: Youtube PROMO
Link: https://youtu.be/dxqrJhBKdbY
- ActiveLink: 1
Name: Youtube Introduction
Link: https://youtu.be/m4_DcrhYhxI

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f88d9af7cb3174e489a3bde98792e30f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,50 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 312ef3862be95544daf14a84810fef28, type: 3}
m_Name: SmartBuilder_Promo
m_EditorClassIdentifier:
Icon: {fileID: 2800000, guid: 1f145b8e365369945babd19bc06a7ef1, type: 3}
PackageShowPrio: 1100
AssetName: SmartBuilder
Subheader: Level Design Tool
AssetIdentifier: Heureka.SmartBuilder
Description: 'SmartBuilder will speed up your level production
100% plug
and play, no setup required!
Smartbuilder gives you a intutitive window
with a list of context sensitive assets - i.e. if you are building a forest,
it gives you a grid of vegetation prefabs and if you are building a Village it
gives you a grid of houses. It will reflect your selection, and always show you
the most relevant prefabs and allow you to drag directly into the scene. It does
this by analyzing the filename, directory, tags and labels of your assets.
'
Links:
- ActiveLink: 1
Name: Asset Store
Link: https://prf.hn/click/camref:1011l4Izm/pubref:Package/destination:https%3A%2F%2Fassetstore.unity.com%2Fpackages%2Fslug%2F206777
- ActiveLink: 1
Name: Documentation
Link: http://docs.heurekagames.com/Documentation%20SmartBuilder.pdf
- ActiveLink: 1
Name: Forum Thread
Link: https://forum.unity.com/threads/released-smartbuilder-level-design-tool.1205263/
- ActiveLink: 1
Name: Youtube Promo
Link: https://youtu.be/O8PZFflOFlE
- ActiveLink: 0
Name: Youtube Introduction
Link:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7022eb5738244fb4ea673f4a62ed656a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e6d1d206fb8345647993ab26ff086d4a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 026529b1e33360243ad8ee16ef8cc114
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@@ -0,0 +1,90 @@
fileFormatVersion: 2
guid: a14c62f6ab555b84184d54decfec1f6d
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
mipmaps:
mipMapMode: 0
enableMipMap: 1
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: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
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: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@@ -0,0 +1,108 @@
fileFormatVersion: 2
guid: 931681cc0eefb7e4985cecbad117a822
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
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
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: 2
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 1
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 64
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 64
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: a7512a29469b06e4498e14e0f1975647
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -0,0 +1,108 @@
fileFormatVersion: 2
guid: c1a521ce2efaeeb4a89e0613e9f428dd
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
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
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: 2
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 1
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 128
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 128
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: b88d9c6b436e0d24a82aa1c3a594a033
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@@ -0,0 +1,144 @@
fileFormatVersion: 2
guid: 1f145b8e365369945babd19bc06a7ef1
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
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
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: 2
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Windows Store Apps
maxTextureSize: 8192
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:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3f7b1051ef739ce45a4bb157499f5b57
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ffa08840e0baf424ab43cde64dfb4e67
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,15 @@
{
"name": "Heureka.Upgrade",
"references": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 8cf8b07d49d6d1b42a8b92313c599089
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,137 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using UnityEditor;
using UnityEditor.PackageManager.Requests;
using UnityEngine;
using Client = UnityEditor.PackageManager.Client;
namespace HeurekaGames.Upgrade
{
[InitializeOnLoad]
public class Upgrader
{
private static readonly string[] oldGuids = new string[2]
{
"dd1f2d14319abfa48923399a4d37e604", //Heureka old top level folder
"6da6390a6dfe6354c959ff13c8212b0f" //AFP Top folder
};
private static readonly string[] heurekaPackages = new string[3]
{
"com.heurekagames.assethunterpro",
"com.heurekagames.assetfinderpro",
"com.heurekagames.smartbuilder"
};
static Upgrader()
{
TryUpgrade(false);
}
/*[MenuItem("Tools/Heureka/TryUpgrade")]
private static void ForceUpgrade()
{
TryUpgrade(true);
}*/
private static void TryUpgrade(bool force)
{
List<string> markedForDelete = new List<string>();
foreach (var guid in oldGuids)
{
var path = AssetDatabase.GUIDToAssetPath(guid);
var oldAsset = AssetDatabase.LoadMainAssetAtPath(path);
if (oldAsset != null)
{
markedForDelete.Add(path);
}
}
string heurekaPath = "Assets/Heureka";
if (AssetDatabase.IsValidFolder(heurekaPath))
markedForDelete.Add(heurekaPath);
if (markedForDelete.Count > 0 || force)
{
if (EditorUtility.DisplayDialog("Heureka Upgrade detected", "Please remove old Heureka Folder and import again through PackageManager (my Assets)", "Ok", DialogOptOutDecisionType.ForThisMachine, "HeurekaUpgradeDontAsk"))
{
#if UNITY_2019_4_OR_NEWER
UnityEditor.PackageManager.UI.Window.Open("");
#endif
}
Debug.LogWarning($"HeurekaGames: Old HeurekaGames assets found");
Debug.LogWarning($"If you experience problems, plaese manually remove the Heureka assets in project, and reimport using Package Manager");
}
/*if (markedForDelete.Count > 0 || force)
{
List<string> outFailedPaths = new List<string>();
#if UNITY_2020_1_OR_NEWER
AssetDatabase.DeleteAssets(markedForDelete.ToArray(), outFailedPaths);
#else
foreach (var item in markedForDelete)
{
AssetDatabase.DeleteAsset(item);
}
#endif
AssetDatabase.Refresh();
resolvePackages();
}*/
}
private static async void resolvePackages()
{
var Request = Client.List(); // List packages installed for the project
while (!Request.IsCompleted)
{
await Task.Delay(100);
}
List<AddRequest> addRequests = new List<AddRequest>();
foreach (var item in Request.Result)
{
if (heurekaPackages.Any(x => x.Equals(item.name)))
{
Debug.Log("Heureka Adding: " + item.name);
addRequests.Add(Client.Add(item.name));
}
}
while (!addRequests.All(x => x.IsCompleted))
{
await Task.Delay(100);
}
ProcessUpgrade();
}
private static void ProcessUpgrade()
{
ClearConsole();
Debug.LogWarning($"HeurekaGames: Old HeurekaGames assets found - Will mark for delete and reimport upgraded package (Now found under 'Packages')");
Debug.LogWarning($"If you experience problems, manually remove the Heureka assets in project, and reimport");
if (EditorUtility.DisplayDialog("Upgrade detected", "Trying to automatically upgrade. If you experience problems, please remove old install and import again through PackageManager", "Ok"))
{
#if UNITY_2019_4_OR_NEWER
UnityEditor.PackageManager.UI.Window.Open("");
#endif
}
#if UNITY_2020_1_OR_NEWER
Client.Resolve();
#endif
}
private static void ClearConsole()
{
Assembly assembly = Assembly.GetAssembly(typeof(SceneView));
Type logEntries = assembly.GetType("UnityEditor.LogEntries");
var clearConsoleMethod = logEntries.GetMethod("Clear");
clearConsoleMethod?.Invoke(new object(), null);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 79d3e23fb3522e04e9eb464f2c65ed60
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
{
"name": "com.heurekagames.utils",
"displayName": "HeurekaGames Utils",
"version": "1.0.3",
"unity": "2019.1",
"description": "This package contains code that is shared among all HeurekaGames Packages"
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 77856d4cfdf29fe49b14a85550c69a95
PackageManifestImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: