2026-04-27 BGM 및 이스터에그

This commit is contained in:
2026-04-27 17:47:44 +09:00
parent 88a71e6292
commit 18d3077cc4
840 changed files with 53720 additions and 4 deletions

View File

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

View File

@@ -0,0 +1,75 @@
using System.Collections.Generic;
using UnityEditor;
namespace TinyGiantStudio.PackageImporter
{
/// <summary>
/// https://docs.unity3d.com/ScriptReference/AssetDatabase-importPackageCompleted.html
///
/// Used to process all callbacks related to importing packages
/// </summary>
///
[InitializeOnLoad]
public class TGS_AssetDatabaseHandler
{
static TGS_AssetDatabaseHandler()
{
AssetDatabase.importPackageCompleted += OnImportPackageCompleted;
}
static bool AutoCheckForUpdates() => EditorPrefs.GetBool("AutoCheckUpdates");
static void OnImportPackageCompleted(string packagename)
{
if (!AutoCheckForUpdates())
return;
TGS_Package.Pipeline pipeline = TGS_ImporterStaticMethods.GetCurrentPipeline();
TGS_Asset[] assets = TGS_ImporterStaticMethods.GetAllTGSAssets();
bool updateAvailable = false;
for (int i = 0; i < assets.Length; i++)
{
if (pipeline == TGS_Package.Pipeline.HDRP)
updateAvailable = UpdateAvailable(assets[i].HDRPPackageAssets);
else if (pipeline == TGS_Package.Pipeline.URP)
updateAvailable = UpdateAvailable(assets[i].URPPackageAssets);
else //if (pipeline == TGS_Package.Pipeline.SRP)
updateAvailable = UpdateAvailable(assets[i].SRPPackageAssets);
if (updateAvailable)
break;
}
if (updateAvailable)
{
TGS_PackageImporterWindow.ShowWindow();
}
}
static bool UpdateAvailable(List<TGS_Package> packages)
{
for (int j = 0; j < packages.Count; j++)
{
if (packages[j].ignoreUpdates)
continue;
if (packages[j].hasPipelineDependancy)
{
if (!TGS_ImporterStaticMethods.ValidPipelineVersion(packages[j].targetPipeline, packages[j].minimumPipelineVersion, packages[j].maximumPipelineVersion))
return false;
}
if (packages[j].hasUnityVersionDependancy)
{
}
if (packages[j].currentVersion != packages[j].GetLastInstalledVersion())
return true;
}
return false;
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: dbb3c5717eae76946b6bb7049e81daac
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 247241
packageName: Modular 3D Text - In-Game 3D UI System
packageVersion: 4.9.2
assetPath: Assets/Plugins/Tiny Giant Studio/Package Importer/Editor/TGS_AssetDatabaseHandler.cs
uploadId: 877966

View File

@@ -0,0 +1,276 @@
using UnityEditor;
using UnityEngine;
namespace TinyGiantStudio.PackageImporter
{
[CustomEditor(typeof(TGS_Asset))]
public class TGS_AssetEditor : Editor
{
TGS_Asset myTarget;
SerializedObject soTarget;
SerializedProperty assetName;
SerializedProperty publisher;
SerializedProperty packages;
GUIStyle headerLabel = null;
GUIStyle groupLabel = null;
GUIStyle packageNameStyle = null;
GUIStyle buttonStyle = null;
void OnEnable()
{
myTarget = (TGS_Asset)target;
soTarget = new SerializedObject(target);
GetReferences();
}
public override void OnInspectorGUI()
{
soTarget.Update();
GenerateStyle();
EditorGUI.BeginChangeCheck();
EditorGUI.indentLevel = 0;
EditorGUILayout.PropertyField(assetName);
EditorGUILayout.PropertyField(publisher);
GUILayout.Space(5);
EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);
EditorGUILayout.LabelField("Packages: " + myTarget.packages.Count, headerLabel, GUILayout.MinWidth(120));
if (GUILayout.Button("Add new package", buttonStyle, GUILayout.MaxWidth(120), GUILayout.MinWidth(120)))
{
AddNewPackage();
}
EditorGUILayout.EndHorizontal();
GUILayout.Space(5);
for (int i = 0; i < myTarget.packages.Count; i++)
{
DrawPackage(i);
if (i + 1 < myTarget.packages.Count)
GUILayout.Space(15);
}
if (EditorGUI.EndChangeCheck())
{
soTarget.ApplyModifiedProperties();
EditorUtility.SetDirty(myTarget);
}
}
private void RedrawWindow()
{
if (EditorWindow.HasOpenInstances<TGS_PackageImporterWindow>())
{
var window = EditorWindow.GetWindow<TGS_PackageImporterWindow>();
window.Close();
TGS_PackageImporterWindow.ShowWindow();
}
}
private void AddNewPackage()
{
myTarget.packages.Add(new TGS_Package());
RedrawWindow();
}
void DrawPackage(int i)
{
if (packages.arraySize <= i)
return;
if (myTarget.packages.Count <= i)
return;
if (myTarget.packages[i] == null)
return;
if (i % 2f == 0)
GUI.color = new Color(0.97f, 0.97f, 1f, 1);
else
GUI.color = new Color(0.97f, 1, 0.97f, 1);
GUILayout.BeginVertical(EditorStyles.helpBox);
float defaultWidth = EditorGUIUtility.labelWidth;
EditorGUIUtility.labelWidth = 40;
GUILayout.BeginHorizontal(EditorStyles.toolbar);
GUILayout.Label(new GUIContent("Name", "User friendly name shown in the importer"), packageNameStyle, GUILayout.MaxWidth(40));
EditorGUILayout.PropertyField(packages.GetArrayElementAtIndex(i).FindPropertyRelative("packageName"), GUIContent.none);
if (GUILayout.Button("Remove", buttonStyle, GUILayout.MinWidth(60), GUILayout.MaxWidth(60)))
{
myTarget.packages.RemoveAt(i);
Repaint();
RedrawWindow();
return;
}
GUILayout.EndHorizontal();
EditorGUI.indentLevel = 1;
EditorGUIUtility.labelWidth = 90;
EditorGUILayout.PropertyField(packages.GetArrayElementAtIndex(i).FindPropertyRelative("package"), new GUIContent("Package", ""));
EditorGUILayout.PropertyField(packages.GetArrayElementAtIndex(i).FindPropertyRelative("Description"), new GUIContent("Description", "Description shown in the importer"));
EditorGUIUtility.labelWidth = 150;
EditorGUILayout.PropertyField(packages.GetArrayElementAtIndex(i).FindPropertyRelative("packageIdentifier"), new GUIContent("Package Indentifier", "The ID used to identify this package. This must be unique."));
GUILayout.Space(5);
PipelineSettings(i);
EditorGUI.indentLevel = 0;
GUILayout.Space(5);
UnityVersionSettings(i);
DebugInfo(i);
GUILayout.Space(5);
GUILayout.EndVertical();
EditorGUIUtility.labelWidth = defaultWidth;
}
void DebugInfo(int i)
{
GUILayout.Space(5);
GUILayout.BeginHorizontal(EditorStyles.toolbar);
EditorGUI.indentLevel = 2;
GUILayout.Label(new GUIContent("Package version info", ""), groupLabel);
GUILayout.EndHorizontal();
EditorGUI.indentLevel = 1;
EditorGUIUtility.labelWidth = 170;
if (myTarget.packages[i].currentVersion == 0)
myTarget.packages[i].currentVersion = 1;
EditorGUILayout.PropertyField(packages.GetArrayElementAtIndex(i).FindPropertyRelative("currentVersion"), new GUIContent("Current package version", ""));
EditorGUILayout.LabelField("Last Installed Version: " + myTarget.packages[i].GetLastInstalledVersion());
EditorGUILayout.PropertyField(packages.GetArrayElementAtIndex(i).FindPropertyRelative("ignoreUpdates"), new GUIContent("Ignore updates", ""));
}
void UnityVersionSettings(int i)
{
GUILayout.Label(new GUIContent("Unity version check not implemented fully yet."), groupLabel, GUILayout.MinWidth(60)); //TODO
EditorGUI.indentLevel = 0;
//GUILayout.BeginVertical(EditorStyles.helpBox);
GUILayout.BeginHorizontal(EditorStyles.toolbar);
EditorGUILayout.PropertyField(packages.GetArrayElementAtIndex(i).FindPropertyRelative("hasUnityVersionDependancy"), GUIContent.none, GUILayout.MaxWidth(20));
GUILayout.Label(new GUIContent("Unity version", "The tick mark controls if there is dependancy to unity version or not."), groupLabel, GUILayout.MinWidth(60));
GUILayout.EndHorizontal();
if (!myTarget.packages[i].hasUnityVersionDependancy)
return;
EditorGUIUtility.labelWidth = 25;
GUILayout.BeginHorizontal();
EditorGUILayout.PropertyField(packages.GetArrayElementAtIndex(i).FindPropertyRelative("minimumUnityVersion"), new GUIContent("Min", "Minimum Unity Version. 0 = any version."), GUILayout.MinWidth(35));
if (myTarget.packages[i].minimumUnityVersion == 0)
GUILayout.Label(new GUIContent("(Any)", "Version 0 is used as any version."), GUILayout.MaxWidth(35));
GUILayout.Label(new GUIContent("|", ""), GUILayout.MaxWidth(10));
EditorGUILayout.PropertyField(packages.GetArrayElementAtIndex(i).FindPropertyRelative("maximumUnityVersion"), new GUIContent("Max", "Maximum Unity version. 0 = any version."), GUILayout.MinWidth(35));
if (myTarget.packages[i].maximumUnityVersion == 0)
GUILayout.Label(new GUIContent("(Any)", "Version 0 is used as any version."), GUILayout.MaxWidth(35));
GUILayout.EndHorizontal();
}
private void PipelineSettings(int i)
{
EditorGUI.indentLevel = 0;
GUILayout.BeginHorizontal(EditorStyles.toolbar);
EditorGUILayout.PropertyField(packages.GetArrayElementAtIndex(i).FindPropertyRelative("hasPipelineDependancy"), GUIContent.none, GUILayout.MaxWidth(20));
GUILayout.Label(new GUIContent("Pipeline", "The tick mark controls if there is dependancy to pipeline or not."), groupLabel, GUILayout.MinWidth(60));
if (myTarget.packages[i].hasPipelineDependancy)
{
EditorGUILayout.PropertyField(packages.GetArrayElementAtIndex(i).FindPropertyRelative("targetPipeline"), GUIContent.none);
}
GUILayout.EndHorizontal();
if (!myTarget.packages[i].hasPipelineDependancy || myTarget.packages[i].targetPipeline == TGS_Package.Pipeline.SRP)
return;
GUILayout.BeginHorizontal();
if (myTarget.packages[i].minimumPipelineVersion.Length != 2)
{
myTarget.packages[i].minimumPipelineVersion = new int[] { 0, 0 };
Repaint();
}
if (myTarget.packages[i].maximumPipelineVersion.Length != 2)
{
myTarget.packages[i].maximumPipelineVersion = new int[] { 0, 0 };
Repaint();
}
//EditorGUILayout.PropertyField(packages.GetArrayElementAtIndex(i).FindPropertyRelative("minimumPipelineVersion"), new GUIContent("Minimum", "Minimum pipeline version. 0 = any version."));
EditorGUIUtility.labelWidth = 110;
GUILayout.Label(new GUIContent("Minimum", "Minimum pipeline version. \n0 = any version."), GUILayout.MinWidth(25), GUILayout.MaxWidth(56));
myTarget.packages[i].minimumPipelineVersion[0] = EditorGUILayout.IntField(myTarget.packages[i].minimumPipelineVersion[0], GUILayout.MinWidth(36), GUILayout.MaxWidth(70));
if (myTarget.packages[i].minimumPipelineVersion[0] == 0)
GUILayout.Label(new GUIContent("(Any)", "Version 0 is used as any version."), GUILayout.MaxWidth(40));
else
{
GUILayout.Label(new GUIContent(".", "Minor version"), GUILayout.MaxWidth(7));
EditorGUIUtility.labelWidth = 1;
myTarget.packages[i].minimumPipelineVersion[1] = EditorGUILayout.IntField(".", myTarget.packages[i].minimumPipelineVersion[1], GUILayout.MinWidth(15), GUILayout.MaxWidth(40));
}
GUILayout.FlexibleSpace();
EditorGUIUtility.labelWidth = 110;
GUILayout.Label(new GUIContent("Maximum", "Maximum pipeline version. \n0 = any version."), GUILayout.MinWidth(26), GUILayout.MaxWidth(56));
myTarget.packages[i].maximumPipelineVersion[0] = EditorGUILayout.IntField(myTarget.packages[i].maximumPipelineVersion[0], GUILayout.MinWidth(36), GUILayout.MaxWidth(70));
if (myTarget.packages[i].maximumPipelineVersion[0] == 0)
GUILayout.Label(new GUIContent("(Any)", "Version 0 is used as any version."), GUILayout.MaxWidth(40));
else
{
GUILayout.Label(new GUIContent(".", "Minor version"), GUILayout.MaxWidth(7));
EditorGUIUtility.labelWidth = 1;
myTarget.packages[i].maximumPipelineVersion[1] = EditorGUILayout.IntField(".", myTarget.packages[i].maximumPipelineVersion[1], GUILayout.MinWidth(15), GUILayout.MaxWidth(40));
}
GUILayout.EndHorizontal();
}
void GetReferences()
{
packages = soTarget.FindProperty("packages");
assetName = soTarget.FindProperty("assetName");
publisher = soTarget.FindProperty("publisher");
}
void GenerateStyle()
{
headerLabel ??= new GUIStyle(EditorStyles.label)
{
fontStyle = FontStyle.Italic,
alignment = TextAnchor.MiddleLeft,
};
groupLabel ??= new GUIStyle(EditorStyles.wordWrappedLabel)
{
fontSize = 12,
};
packageNameStyle ??= new GUIStyle(EditorStyles.wordWrappedLabel)
{
fontSize = 12,
fontStyle = FontStyle.Bold
};
buttonStyle = new GUIStyle(EditorStyles.toolbarButton)
{
fontStyle = FontStyle.Italic,
};
packageNameStyle.normal.textColor = Color.yellow;
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 364235d35c9ad344184685fffd5fef69
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 247241
packageName: Modular 3D Text - In-Game 3D UI System
packageVersion: 4.9.2
assetPath: Assets/Plugins/Tiny Giant Studio/Package Importer/Editor/TGS_AssetEditor.cs
uploadId: 877966

View File

@@ -0,0 +1,183 @@
using System;
using UnityEditor;
using UnityEngine;
using UnityEngine.Rendering;
using static TinyGiantStudio.PackageImporter.TGS_Package;
namespace TinyGiantStudio.PackageImporter
{
internal class TGS_ImporterStaticMethods : MonoBehaviour
{
public static TGS_Asset[] GetAllTGSAssets()
{
string[] guids = AssetDatabase.FindAssets("t:" + typeof(TGS_Asset).Name); //FindAssets uses tags check documentation for more info
TGS_Asset[] assets = new TGS_Asset[guids.Length];
for (int i = 0; i < guids.Length; i++) //probably could get optimized
{
string path = AssetDatabase.GUIDToAssetPath(guids[i]);
assets[i] = AssetDatabase.LoadAssetAtPath<TGS_Asset>(path);
}
for (int i = 0; i < assets.Length; i++)
{
assets[i].UpdateList();
}
return assets;
}
#region Pipeline stuff
//Gets Current Pipeline
public static TGS_Package.Pipeline GetCurrentPipeline()
{
//Checks if there is any Render Pipeline asset in the graphics settings
if (GraphicsSettings.currentRenderPipeline)
{
//Gets the type name of the Render Pipeline asset
string pipelineAssetName = GraphicsSettings.currentRenderPipeline.GetType().Name;
//Validates if its really a pipeline asset
if (pipelineAssetName.EndsWith("RenderPipelineAsset"))
{
//If Pipeline asset name starts with HD it means its High Defination Render Pipeline
if (pipelineAssetName.StartsWith("HD"))
{
//Marks current pipeline as High Defination Render Pipeline
return TGS_Package.Pipeline.HDRP;
}
//If Pipeline asset name starts with Universal it means its Universal Render Pipeline
else if (pipelineAssetName.StartsWith("Universal"))
{
//Marks current pipeline as Universal Render Pipeline
return TGS_Package.Pipeline.URP;
}
}
else //If no
{
//Marks current pipeline as Standard Render Pipeline
return TGS_Package.Pipeline.SRP;
}
}
//If it has no Render Pipeline asset then
//Marks current pipeline as Standard Render Pipeline
return TGS_Package.Pipeline.SRP;
}
/// <summary>
/// Only call this if target and current pipeline is same
/// </summary>
/// <param name="currentAndTargetPipeline">Is it target or current package </param>
/// <param name="minimumPipelineVersionRequired"></param>
/// <param name="maximumPipelineVersionAllowed"></param>
/// <returns></returns>
public static bool ValidPipelineVersion(Pipeline currentAndTargetPipeline, int[] minimumPipelineVersionRequired, int[] maximumPipelineVersionAllowed)
{
int[] currentPipelineVersion = PipelineVersion(currentAndTargetPipeline); //current installed version
bool validMinimumPipelineVersion = ValidMinimumPipelineVersion(currentPipelineVersion, minimumPipelineVersionRequired);
bool validMaximumPipelineVersion = ValidMaximumPipelineVersion(currentPipelineVersion, maximumPipelineVersionAllowed);
if (validMinimumPipelineVersion && validMaximumPipelineVersion)
return true;
return false;
}
/// <summary>
/// Here int[] = int major version, int minor version of the package
/// </summary>
static bool ValidMinimumPipelineVersion(int[] currentPipelineVersion, int[] minimumPipelineVersionRequired)
{
if (minimumPipelineVersionRequired == null || currentPipelineVersion == null)
return true;
if (minimumPipelineVersionRequired.Length == 0 || currentPipelineVersion.Length == 0)
return true;
if (minimumPipelineVersionRequired[0] == 0)
return true;
if (currentPipelineVersion[0] == minimumPipelineVersionRequired[0]) //same major version
{
if (currentPipelineVersion[1] < minimumPipelineVersionRequired[1]) //but lower minor version than required
return false;
}
if (currentPipelineVersion[0] < minimumPipelineVersionRequired[0]) //less than required minimum major version
return false;
return true;
}
static bool ValidMaximumPipelineVersion(int[] currentPipelineVersion, int[] maximumPipelineVersionAllowed)
{
if (maximumPipelineVersionAllowed == null || currentPipelineVersion == null)
return true;
if (maximumPipelineVersionAllowed.Length == 0 || currentPipelineVersion.Length == 0)
return true;
if (maximumPipelineVersionAllowed[0] == 0)
return true;
if (currentPipelineVersion[0] == maximumPipelineVersionAllowed[0]) //same major version
{
if (currentPipelineVersion[1] > maximumPipelineVersionAllowed[1]) //but higher minor version that accepted
return false;
}
if (currentPipelineVersion[0] > maximumPipelineVersionAllowed[0]) //more than allowed max version(major)
return false;
return true;
}
static int[] PipelineVersion(Pipeline pipeline)
{
string pipelineBundleIdentifier = GetPipelineBundleIdentifier(pipeline);
var package = TGS_PackageManagerAgent.GetPackage(pipelineBundleIdentifier);
if (package != null)
{
var versions = package.version.Split('.');
return Array.ConvertAll(versions, s => int.Parse(s));
}
else
return new int[] { 0, 0 };
}
/// <summary>
/// Doesnt work with SRP
/// </summary>
/// <param name="asset"></param>
/// <returns></returns>
public static string GetPipelineBundleIdentifier(Pipeline pipeline)
{
//srp doesnt call it
string packageID;
switch (pipeline)
{
case TGS_Package.Pipeline.URP:
packageID = "com.unity.render-pipelines.universal";
break;
//case TGSPackageAsset.Pipeline.HDRP:
default:
packageID = "com.unity.render-pipelines.high-definition";
break;
}
return packageID;
}
#endregion Pipeline staff
#region Unity version
static bool ValidUnityVersion(float minimumUnityVersion, float maximumUnityVersion)
{
return false;
}
#endregion
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: a62844b93cfee084682a152b337a06fd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 247241
packageName: Modular 3D Text - In-Game 3D UI System
packageVersion: 4.9.2
assetPath: Assets/Plugins/Tiny Giant Studio/Package Importer/Editor/TGS_ImporterStaticMethods.cs
uploadId: 877966

View File

@@ -0,0 +1,47 @@
using System;
using UnityEditor;
using UnityEngine;
namespace TinyGiantStudio.PackageImporter
{
/// <summary>
/// Contains information about a package
/// </summary>
[Serializable]
internal class TGS_Package
{
public string packageName;
public DefaultAsset package;
[Tooltip("The description of the unitypackage")]
public string Description;
public string packageIdentifier = "Unique Package Indentifier";
public bool hasPipelineDependancy = false;
public Pipeline targetPipeline;
public int[] minimumPipelineVersion;
public int[] maximumPipelineVersion;
public bool hasUnityVersionDependancy = false;
public double minimumUnityVersion;
public double maximumUnityVersion;
public int currentVersion = 1;
public int GetLastInstalledVersion() => EditorPrefs.GetInt("TinyGiantStudio.PackageImporter." + packageIdentifier + ".LastInstalledVersion");
public void UpdateLastInstalledVersion() => EditorPrefs.SetInt("TinyGiantStudio.PackageImporter." + packageIdentifier + ".LastInstalledVersion", currentVersion);
public bool ignoreUpdates;
public enum Pipeline
{
SRP,
URP,
HDRP
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 36e581f19d370424f8c30e34dad3f485
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 247241
packageName: Modular 3D Text - In-Game 3D UI System
packageVersion: 4.9.2
assetPath: Assets/Plugins/Tiny Giant Studio/Package Importer/Editor/TGS_Package.cs
uploadId: 877966

View File

@@ -0,0 +1,729 @@
using System;
using UnityEditor;
using UnityEditor.AnimatedValues;
using UnityEngine;
namespace TinyGiantStudio.PackageImporter
{
internal class TGS_PackageImporterWindow : EditorWindow
{
/// <summary>
///
/// </summary>
readonly string importerVersion = "1.0.1a";
private TGS_Asset[] assets;
//Current installed pipeline
private TGS_Package.Pipeline currentPipeline;
//Scroll Area of packages list and rp foldouts
private Vector2 assetsScrollView;
private Vector2 packagesScrollView;
GUIStyle openedAsset;
GUIStyle assetHeaderStyle = null;
GUIStyle smallGreyLabel = null;
GUIStyle centeredGreyLabel = null;
GUIStyle foldOutStyle = null;
GUIStyle noteStyle = null;
GUIStyle paragraphStyle = null;
GUIStyle assetNotesStyle = null;
GUIStyle srpHeaderStyle = null;
GUIStyle toolBarButtonStyle = null;
GUIStyle warningStyle = null;
GUIStyle ignoreUpdateStyle = null;
Color openedFoldoutTitleColor = new Color(136 / 255f, 173 / 255f, 234 / 255f, 1f);
Color openedFoldoutTitleColor_lightSkin = new Color(123f / 255f, 120f / 255f, 0, 1f);
Color openedFoldoutTitleColor_darkSkin = new Color(240f / 255f, 241f / 255f, 101f / 255f, 1f);
AnimBool showAnyPipelinePackages;
AnimBool showSRPPackages;
AnimBool showURPPackages;
AnimBool showHDRPPackages;
static Texture faviconIcon;
static Texture titleIcon;
int selectedAsset = 0;
bool autoCheckUpdate;
readonly string checkUpdatePref = "AutoCheckUpdates";
private void OnAwake()
{
TGS_PackageManagerAgent.Check();
}
void OnEnable()
{
faviconIcon = EditorGUIUtility.Load("Assets/Plugins/Tiny Giant Studio/Package Importer/Utility/Editor Icons/Favicon.png") as Texture2D;
titleIcon = EditorGUIUtility.Load("Assets/Plugins/Tiny Giant Studio/Package Importer/Utility/Editor Icons/TGS Logo.png") as Texture2D;
assets = TGS_ImporterStaticMethods.GetAllTGSAssets();
autoCheckUpdate = EditorPrefs.GetBool(checkUpdatePref);
currentPipeline = TGS_ImporterStaticMethods.GetCurrentPipeline();
SetAnimBools(); //needs current pipeline
}
[MenuItem("Tools/Tiny Giant Studio/Package Importer", false, 102)]
public static void ShowWindow()
{
EditorWindow editorWindow = GetWindow<TGS_PackageImporterWindow>("TGS Package Importer");
editorWindow.titleContent = new GUIContent(" TGS Package Importer", faviconIcon, "");
editorWindow.minSize = new Vector2(850, 400);
}
void OnGUI()
{
GenerateStyle();
EditorGUI.BeginChangeCheck();
GUILayout.Space(10);
GUILayout.Label("Please import the right packages for your pipeline.", centeredGreyLabel);
GUILayout.Space(10);
if (assets != null)
{
if (assets.Length > 0)
{
GUILayout.BeginHorizontal();
DrawAssetsList();
DrawSelectedAsset();
GUILayout.EndHorizontal();
}
else
{
GUILayout.Label("No asset found. Please create a new asset importer file to be discovered.", noteStyle);
GUILayout.Space(15);
}
}
else
{
assets = TGS_ImporterStaticMethods.GetAllTGSAssets();
}
BottomInformation();
if (EditorGUI.EndChangeCheck())
{
EditorPrefs.SetBool(checkUpdatePref, autoCheckUpdate);
}
}
void DrawAssetsList()
{
GUILayout.BeginVertical("Box", GUILayout.MinWidth(200), GUILayout.MaxWidth(200));
assetsScrollView = EditorGUILayout.BeginScrollView(assetsScrollView, false, false, GUIStyle.none, GUI.skin.verticalScrollbar, GUIStyle.none);
for (int i = 0; i < assets.Length; i++)
{
if (selectedAsset != i)
{
GUI.backgroundColor = new Color(0.9f, 0.9f, 0.9f, 1f);
GUILayout.BeginVertical(EditorStyles.toolbar);
GUILayout.BeginHorizontal();
EditorGUILayout.LabelField(EditorGUIUtility.IconContent("d_Folder Icon"), GUILayout.MaxWidth(15));
if (GUILayout.Button(new GUIContent(" " + assets[i].assetName, "File name: " + assets[i].name), EditorStyles.label))
{
selectedAsset = i;
}
GUILayout.EndHorizontal();
GUILayout.EndVertical();
}
else
{
GUI.backgroundColor = Color.white;
GUILayout.BeginVertical(EditorStyles.toolbar);
GUILayout.BeginHorizontal();
EditorGUILayout.LabelField(EditorGUIUtility.IconContent("d_FolderOpened Icon"), GUILayout.MaxWidth(15));
EditorGUILayout.LabelField(new GUIContent(" " + assets[i].assetName, "File name: " + assets[i].name), openedAsset);
GUILayout.EndHorizontal();
GUILayout.EndVertical();
}
}
GUI.backgroundColor = Color.white;
EditorGUILayout.EndScrollView();
GUILayout.FlexibleSpace();
GUILayout.EndVertical();
}
private void DrawSelectedAsset()
{
packagesScrollView = EditorGUILayout.BeginScrollView(packagesScrollView, false, false, GUIStyle.none, GUI.skin.verticalScrollbar, GUIStyle.none);
int i = selectedAsset;
//for (int i = 0; i < assets.Length; i++)
{
//GUILayout.BeginVertical(EditorStyles.helpBox);
GUILayout.Space(5);
AssetInformation(assets[i]);
GUILayout.Space(15);
AnyPipelinePackages(assets[i]);
GUILayout.Space(10);
RPPackages(i);
}
EditorGUILayout.EndScrollView();
}
private void RPPackages(int i)
{
if (currentPipeline == TGS_Package.Pipeline.URP)
{
URPPackages(assets[i]);
GUILayout.Space(10);
HDRPPackages(assets[i]);
GUILayout.Space(10);
SRPPackages(assets[i]);
}
else if (currentPipeline == TGS_Package.Pipeline.HDRP)
{
HDRPPackages(assets[i]);
GUILayout.Space(10);
URPPackages(assets[i]);
GUILayout.Space(10);
SRPPackages(assets[i]);
}
else
{
SRPPackages(assets[i]);
GUILayout.Space(10);
URPPackages(assets[i]);
GUILayout.Space(10);
HDRPPackages(assets[i]);
}
}
void AssetInformation(TGS_Asset asset)
{
if (asset == null)
return;
GUILayout.Label(new GUIContent(asset.assetName, "File name: " + asset.name), assetHeaderStyle);
GUILayout.Label(asset.publisher, smallGreyLabel);
}
void AnyPipelinePackages(TGS_Asset asset)
{
if (asset.AnyPipelinePackageAssets.Count == 0)
return;
EditorGUI.indentLevel = 0;
GUILayout.BeginVertical(EditorStyles.helpBox);
GUILayout.BeginHorizontal(EditorStyles.toolbar);
showAnyPipelinePackages.target = EditorGUILayout.Foldout(showAnyPipelinePackages.target, new GUIContent("Any Pipeline Packages", ""), true, foldOutStyle);
ImportAllButton(TGS_Package.Pipeline.SRP); //todo
GUILayout.EndHorizontal();
GUILayout.Space(5);
if (EditorGUILayout.BeginFadeGroup(showAnyPipelinePackages.faded))
{
GUILayout.BeginVertical("helpbox");
foreach (var package in asset.AnyPipelinePackageAssets)
{
DrawPacakge(package, false);
}
GUILayout.EndVertical();
}
EditorGUILayout.EndFadeGroup();
GUILayout.EndVertical();
}
void SRPPackages(TGS_Asset asset)
{
if (asset.SRPPackageAssets.Count == 0)
return;
EditorGUI.indentLevel = 0;
GUILayout.BeginVertical(EditorStyles.helpBox);
GUILayout.BeginHorizontal(EditorStyles.toolbar);
showSRPPackages.target = EditorGUILayout.Foldout(showSRPPackages.target, new GUIContent("Standard Pipeline Packages", ""), true, foldOutStyle);
if (currentPipeline == TGS_Package.Pipeline.SRP)
GUILayout.Label("[Current Pipeline]", noteStyle, GUILayout.MaxWidth(110));
else
GUILayout.Label("[Wrong Pipeline]", warningStyle, GUILayout.MaxWidth(110));
ImportAllButton(TGS_Package.Pipeline.SRP);
GUILayout.EndHorizontal();
GUILayout.Space(5);
if (EditorGUILayout.BeginFadeGroup(showSRPPackages.faded))
{
GUILayout.BeginVertical("helpbox");
foreach (var package in asset.SRPPackageAssets)
{
if (package.hasPipelineDependancy)
DrawPacakge(package, currentPipeline == TGS_Package.Pipeline.SRP);
}
GUILayout.EndVertical();
}
EditorGUILayout.EndFadeGroup();
GUILayout.EndVertical();
}
void URPPackages(TGS_Asset asset)
{
if (asset.URPPackageAssets.Count == 0)
return;
EditorGUI.indentLevel = 0;
GUILayout.BeginVertical(EditorStyles.helpBox);
GUILayout.BeginHorizontal(EditorStyles.toolbar);
showURPPackages.target = EditorGUILayout.Foldout(showURPPackages.target, new GUIContent("Universal Render Pipeline Packages", ""), true, foldOutStyle);
if (currentPipeline == TGS_Package.Pipeline.URP)
GUILayout.Label("[Current Pipeline]", noteStyle, GUILayout.MaxWidth(110));
else
GUILayout.Label("[Wrong Pipeline]", warningStyle, GUILayout.MaxWidth(110));
ImportAllButton(TGS_Package.Pipeline.URP);
GUILayout.EndHorizontal();
GUILayout.Space(5);
if (EditorGUILayout.BeginFadeGroup(showURPPackages.faded))
{
GUILayout.BeginVertical("helpbox");
foreach (var package in asset.URPPackageAssets)
{
DrawPacakge(package, currentPipeline == TGS_Package.Pipeline.URP);
}
GUILayout.EndVertical();
}
EditorGUILayout.EndFadeGroup();
GUILayout.EndVertical();
}
void HDRPPackages(TGS_Asset asset)
{
if (asset.HDRPPackageAssets.Count == 0)
return;
EditorGUI.indentLevel = 0;
GUILayout.BeginVertical(EditorStyles.helpBox);
GUILayout.BeginHorizontal(EditorStyles.toolbar);
showHDRPPackages.target = EditorGUILayout.Foldout(showHDRPPackages.target, new GUIContent("High Definition Render Pipeline Packages", ""), true, foldOutStyle);
if (currentPipeline == TGS_Package.Pipeline.HDRP)
GUILayout.Label("[Current Pipeline]", noteStyle, GUILayout.MaxWidth(110));
else
GUILayout.Label("[Wrong Pipeline]", warningStyle, GUILayout.MaxWidth(110));
ImportAllButton(TGS_Package.Pipeline.HDRP);
GUILayout.EndHorizontal();
GUILayout.Space(5);
if (EditorGUILayout.BeginFadeGroup(showHDRPPackages.faded))
{
GUILayout.BeginVertical("helpbox");
foreach (var package in asset.HDRPPackageAssets)
{
DrawPacakge(package, currentPipeline == TGS_Package.Pipeline.HDRP);
}
GUILayout.EndVertical();
}
EditorGUILayout.EndFadeGroup();
GUILayout.EndVertical();
}
void BottomInformation()
{
EditorGUI.indentLevel = 0;
GUILayout.BeginHorizontal(GUILayout.MaxHeight(50)); //-----------
GUILayout.Label(titleIcon, GUILayout.MaxHeight(60), GUILayout.MaxWidth(60));
GUILayout.BeginVertical();
if (GUILayout.Button("Tiny Giant Studio", srpHeaderStyle))
{
Application.OpenURL("https://assetstore.unity.com/publishers/45848?aid=1011ljxWe&utm_source=aff");
}
//GUILayout.Label("Tiny Giant Studio", srpHeaderStyle);
GUILayout.Label("Package importer version: " + importerVersion, paragraphStyle);
GUILayout.Label("Current pipeline: " + currentPipeline + " | Current unity version: " + Application.unityVersion, paragraphStyle);
GUILayout.EndVertical();
var v = new GUIContent("Check for updates", "If disabled, when importing assets, it won't check for for new updates.");
GUILayout.BeginVertical(GUILayout.MaxHeight(50), GUILayout.MaxWidth(156)); //-----------
GUILayout.FlexibleSpace();
autoCheckUpdate = EditorGUILayout.Toggle(v, autoCheckUpdate);
GUILayout.EndVertical();
GUILayout.EndHorizontal();//---------------------
}
void DrawPacakge(TGS_Package asset, bool correctPipeline = false)
{
if (asset == null) return;
EditorGUI.indentLevel = 1;
bool hasPackage = asset.package != null;
GUIContent assetTitle;
if (!string.IsNullOrEmpty(asset.packageName))
assetTitle = new GUIContent(asset.packageName);
else if (asset.package != null)
assetTitle = new GUIContent(" " + asset.package.name);
else
assetTitle = new GUIContent("Unnamed asset");
GUILayout.BeginHorizontal(EditorStyles.toolbar);
EditorGUILayout.LabelField(assetTitle, srpHeaderStyle, GUILayout.MinWidth(200));
EditorGUILayout.LabelField("v" + asset.currentVersion, ignoreUpdateStyle, GUILayout.MinWidth(50));
GUILayout.FlexibleSpace();
if (hasPackage)
{
if (autoCheckUpdate)
DrawIgnoreUpdatesUI(asset);
DrawUpgradeAvailability(asset, correctPipeline);
DrawImportButton(asset);
}
GUILayout.EndHorizontal();
EditorGUI.indentLevel = 2;
if (hasPackage && !string.IsNullOrWhiteSpace(asset.Description))
EditorGUILayout.LabelField(asset.Description, paragraphStyle);
if (!hasPackage)
{
EditorGUILayout.LabelField("No package selected", warningStyle);
return;
}
string piplelineVersionWarning = PipelineVersionWarning(asset);
if (!string.IsNullOrEmpty(piplelineVersionWarning))
EditorGUILayout.LabelField(piplelineVersionWarning, warningStyle);
string versionWarning = UnityVersionWarning(asset);
if (!string.IsNullOrEmpty(versionWarning))
{
EditorGUILayout.LabelField(versionWarning, warningStyle);
}
if (asset.GetLastInstalledVersion() != 0)
EditorGUILayout.LabelField("Last installed version: " + asset.GetLastInstalledVersion(), ignoreUpdateStyle);
GUILayout.Space(2);
EditorGUI.indentLevel = 0;
}
void DrawImportButton(TGS_Package asset)
{
if (GUILayout.Button("Import", toolBarButtonStyle, GUILayout.MaxWidth(60)))
{
if (asset.package != null)
{
////If the current pipeline is not same as package's target pipeline
////if (currentPipeline != asset.targetPipeline)
//if (asset.hasPipelineDependancy && ImporterStaticMethods.ValidPipelineVersion(asset.targetPipeline, asset.minimumPipelineVersion, asset.maximumPipelineVersion))
//{
// //Validates if the user wants to import risking errors of non supported packages by the current Render Pipeline
// if (EditorUtility.DisplayDialog("Warning!", asset.targetPipeline.ToString() + " is not installed. Importing non-supported assets might not work properly", "Proceed", "Cancel"))
// {
// //If Cancel then end the method
// AssetDatabase.ImportPackage(AssetDatabase.GetAssetPath(asset.package), true);
// asset.lastInstalledVersion = asset.currentVersion;
// }
//}
//else
//Otherwise import each package without showing whtas inside of them
AssetDatabase.ImportPackage(AssetDatabase.GetAssetPath(asset.package), true);
asset.UpdateLastInstalledVersion();
}
else
{
EditorUtility.DisplayDialog("Package couldn't be found", "The asset packages seems to be missing from it's intended path. Please redownload the asset.\nIf the problem presists after that, please contact support: \nferdowsurasif@gmail.com", "Ok");
}
}
}
void DrawUpgradeAvailability(TGS_Package asset, bool correctPipeline)
{
if (correctPipeline && asset.GetLastInstalledVersion() != asset.currentVersion)
{
if (asset.ignoreUpdates)
GUILayout.Label("Upgrade available", ignoreUpdateStyle, GUILayout.MinWidth(120), GUILayout.MaxWidth(120));
else
GUILayout.Label("Upgrade available", noteStyle, GUILayout.MinWidth(120), GUILayout.MaxWidth(120));
}
}
void DrawIgnoreUpdatesUI(TGS_Package asset)
{
GUILayout.BeginHorizontal(EditorStyles.toolbarButton);
GUIContent ignoreContent = new GUIContent("Ignore Updates", "This ignores update check on asset import. \nSo, when you update the asset and there is a update availabe, that will be ignored.");
GUILayout.Label(ignoreContent, ignoreUpdateStyle, GUILayout.MaxWidth(90));
asset.ignoreUpdates = EditorGUILayout.Toggle(GUIContent.none, asset.ignoreUpdates, GUILayout.MaxWidth(30));
GUILayout.EndHorizontal();
}
string PipelineVersionWarning(TGS_Package asset)
{
if (!asset.hasPipelineDependancy)
return "";
string warnings = "";
if (asset.targetPipeline != currentPipeline)
return warnings += "[ Incorrect pipeline ]";
if (asset.targetPipeline == TGS_Package.Pipeline.SRP)
return warnings;
if (asset.targetPipeline == currentPipeline)
{
bool rightPipeline = TGS_ImporterStaticMethods.ValidPipelineVersion(asset.targetPipeline, asset.minimumPipelineVersion, asset.maximumPipelineVersion);
if (!rightPipeline) warnings += "[ Incorrect pipeline version ]";
}
return warnings;
}
string UnityVersionWarning(TGS_Package asset)
{
if (asset.minimumUnityVersion <= 0 && asset.maximumUnityVersion <= 0)
return "";
string warnings = "";
//Get current unity verison's first 2 parts Major and Minor excluding the release and converts to double for comparism
double currentUnityVersion = Convert.ToDouble(Application.unityVersion.Substring(0, 6));
//If assets minimum version is less then current unity version then throws a exception even though its not visible
if (currentUnityVersion != 0 && currentUnityVersion < asset.minimumUnityVersion)
warnings += "Current unity version :" + currentUnityVersion + " is lower than the minimum " + asset.minimumUnityVersion + " for this package.";
if (currentUnityVersion != 0 && currentUnityVersion > asset.minimumUnityVersion)
warnings += "Current unity version " + currentUnityVersion + " is higher than the maxmimum " + asset.maximumUnityVersion + " for this package.";
return warnings;
}
void ImportAllButton(TGS_Package.Pipeline pipeline)
{
//TODO
//commented out because there is no prompt like normal package import if this one is clicked
//if (GUILayout.Button("Import All", toolBarButtonStyle, GUILayout.MaxWidth(75)))
//{
// //Validates if the user wants to import all packages in side the foldout
// if (EditorUtility.DisplayDialog("Are you sure?", $"Proceed to import all {Enum.GetName(typeof(TGSPackageAsset.Pipeline), pipeline)} supported packages.", "Proceed", "Cancel"))
// {
// //A local list of package that will be used to import
// List<TGSPackageAsset> importablePackages = null;
// //Checks which pipeline was sent as parameter and assigns importablePackges to their respective package list for each Render Pipeline
// switch (pipeline)
// {
// case TGSPackageAsset.Pipeline.SRP:
// importablePackages = importerSettings.SRPPackageAssets;
// break;
// case TGSPackageAsset.Pipeline.URP:
// importablePackages = importerSettings.URPPackageAssets;
// break;
// case TGSPackageAsset.Pipeline.HDRP:
// importablePackages = importerSettings.HDRPPackageAssets;
// break;
// }
// //Iterates trough the importablePackages
// for (int i = 0; i < importablePackages.Count; i++)
// {
// //If the current pipeline is not same as first package's target pipeline of the list.
// if (currentPipeline != importablePackages[i].targetPipeline && i == 0)
// {
// //Validates if the user wants to import risking errors of non supported packages by the current Render Pipeline
// if (!EditorUtility.DisplayDialog("Warning!", importablePackages[i].targetPipeline.ToString() + " is not installed. Importing non-supported assets might not work properly", "Proceed", "Cancel"))
// {
// //If Cancel then brake the loop
// break;
// }
// }
// //Otherwise import each package without showing whtas inside of them
// AssetDatabase.ImportPackage(AssetDatabase.GetAssetPath(importablePackages[i].package), false);
// }
// }
//}
}
void SetAnimBools()
{
if (currentPipeline == TGS_Package.Pipeline.SRP)
showSRPPackages = new AnimBool(true);
else
showSRPPackages = new AnimBool(false);
showSRPPackages.valueChanged.AddListener(Repaint);
if (currentPipeline == TGS_Package.Pipeline.URP)
showURPPackages = new AnimBool(true);
else
showURPPackages = new AnimBool(false);
showURPPackages.valueChanged.AddListener(Repaint);
if (currentPipeline == TGS_Package.Pipeline.HDRP)
showHDRPPackages = new AnimBool(true);
else
showHDRPPackages = new AnimBool(false);
showHDRPPackages.valueChanged.AddListener(Repaint);
showAnyPipelinePackages = new AnimBool(false);
showAnyPipelinePackages.valueChanged.AddListener(Repaint);
}
void GenerateStyle()
{
if (EditorGUIUtility.isProSkin)
{
openedFoldoutTitleColor = openedFoldoutTitleColor_darkSkin;
}
else
{
openedFoldoutTitleColor = openedFoldoutTitleColor_lightSkin;
}
if (openedAsset == null)
{
openedAsset = new GUIStyle(EditorStyles.label)
{
fontStyle = FontStyle.Bold,
fontSize = 13
};
openedAsset.onNormal.textColor = openedFoldoutTitleColor;
}
if (assetHeaderStyle == null)
{
assetHeaderStyle = new GUIStyle(EditorStyles.largeLabel)
{
fontStyle = FontStyle.Bold,
fontSize = 16
};
assetHeaderStyle.normal.textColor = Color.white;
}
if (smallGreyLabel == null)
{
smallGreyLabel = new GUIStyle(EditorStyles.miniLabel)
{
fontStyle = FontStyle.Italic,
};
}
if (centeredGreyLabel == null)
{
centeredGreyLabel = new GUIStyle(EditorStyles.centeredGreyMiniLabel)
{
fontStyle = FontStyle.Italic,
fontSize = 16
};
}
if (foldOutStyle == null)
{
foldOutStyle = new GUIStyle(EditorStyles.foldout)
{
fontStyle = FontStyle.Bold,
fontSize = 12
};
foldOutStyle.onNormal.textColor = openedFoldoutTitleColor;
}
if (noteStyle == null)
{
noteStyle = new GUIStyle(EditorStyles.wordWrappedLabel)
{
fontStyle = FontStyle.Italic
};
noteStyle.normal.textColor = Color.green;
}
if (warningStyle == null)
{
warningStyle = new GUIStyle(EditorStyles.label)
{
fontStyle = FontStyle.Italic
};
warningStyle.normal.textColor = new Color(1, 0.5f, 0.5f);
}
if (srpHeaderStyle == null)
{
srpHeaderStyle = new GUIStyle(EditorStyles.wordWrappedLabel)
{
fontStyle = FontStyle.Bold,
};
}
if (assetNotesStyle == null)
{
assetNotesStyle = new GUIStyle(EditorStyles.centeredGreyMiniLabel)
{
fontStyle = FontStyle.Italic
};
}
if (paragraphStyle == null)
{
paragraphStyle = new GUIStyle(EditorStyles.wordWrappedLabel)
{
fontSize = 11,
fontStyle = FontStyle.Italic
};
}
if (toolBarButtonStyle == null)
{
toolBarButtonStyle = new GUIStyle(EditorStyles.toolbarButton)
{
fontStyle = FontStyle.BoldAndItalic
};
}
if (ignoreUpdateStyle == null)
{
ignoreUpdateStyle = new GUIStyle(EditorStyles.label)
{
fontStyle = FontStyle.Italic,
};
ignoreUpdateStyle.normal.textColor = new Color(1f, 1f, 1f, 0.5f);
}
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 18694bd59ff012e4cada243d0aa3327c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 247241
packageName: Modular 3D Text - In-Game 3D UI System
packageVersion: 4.9.2
assetPath: Assets/Plugins/Tiny Giant Studio/Package Importer/Editor/TGS_PackageImporterWindow.cs
uploadId: 877966

View File

@@ -0,0 +1,126 @@
using UnityEditor;
using UnityEditor.PackageManager;
using UnityEditor.PackageManager.Requests;
using UnityEngine;
namespace TinyGiantStudio.PackageImporter
{
/// <summary>
/// Handles talking to unity for information
/// </summary>
internal class TGS_PackageManagerAgent
{
//The request needed to get packages list
private static ListRequest Request;
//List of installed packages
private static PackageCollection packages;
//To check if still featching packages list
private static bool isChecking;
//Initialiization called after every domain reload on unity editor
//[InitializeOnLoadMethod] //TODO: Seems unnecessary
public static void Check()
{
//Requests for new list allowing for offline search
Request = Client.List(offlineMode: true);
//Adds callback in the Editor Application's update event
EditorApplication.update += FetchList;
}
static void FetchList()
{
isChecking = true;
if (Request.IsCompleted)
{
if (Request.Status == StatusCode.Success)
packages = Request.Result;
else if (Request.Status >= StatusCode.Failure)
Debug.LogWarning("Could not check for packages: " + Request.Error.message);
//Marks as isChecking to false
isChecking = false;
//Remove callback from the Editor Application's update event
EditorApplication.update -= FetchList;
}
}
//To check if a package with the packagename parameter exists in the installed packages list
public static bool ContainsPackage(string packageName)
{
//if packages list is null and not checking for packages
if (packages == null && !isChecking)
{
//Request for package checking
Check();
//End function
return false;
}
if (packages == null)
return false;
if (isChecking)
return false;
//Iterate through installed packages list
foreach (var package in packages)
{
if (package == null)
continue;
if (string.IsNullOrEmpty(package.name))
continue;
//If package found with given name
if (package.name == packageName)
{
//End function and return that package exists
return true;
}
}
//End function
return false;
}
//To get the package if a package with the packagename parameter exists in the installed packages list
public static UnityEditor.PackageManager.PackageInfo GetPackage(string packageName)
{
//if packages list is null and not checking for packages
if (packages == null && !isChecking)
{
//Request for package checking
Check();
//End function
return null;
}
if (isChecking)
return null;
//Iterate through installed packages list
foreach (var package in packages)
{
//If package found with given name
if (package.name == packageName)
{
//End function and return that package
return package;
}
}
return null;
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 2c8c807231f27154cb418c8d3f5073f9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 247241
packageName: Modular 3D Text - In-Game 3D UI System
packageVersion: 4.9.2
assetPath: Assets/Plugins/Tiny Giant Studio/Package Importer/Editor/TGS_PackageManagerAgent.cs
uploadId: 877966

View File

@@ -0,0 +1,35 @@
using System.Collections.Generic;
using UnityEngine;
namespace TinyGiantStudio.PackageImporter
{
/// <summary>
/// This is an internal scriptable object file. Not meant for end user
/// </summary>
[CreateAssetMenu(fileName = "New Asset Importer", menuName = "Tiny Giant Studio/Package Importer/New Asset Importer")]
internal class TGS_Asset : ScriptableObject
{
public string assetName = "Asset name";
public string publisher = "Publisher";
[Tooltip("This is an internal scriptable object file. Not meant for end user")]
public List<TGS_Package> packages = new List<TGS_Package>();
public List<TGS_Package> SRPPackageAssets { get; private set; } = new List<TGS_Package>();
public List<TGS_Package> URPPackageAssets { get; private set; } = new List<TGS_Package>();
public List<TGS_Package> HDRPPackageAssets { get; private set; } = new List<TGS_Package>();
public List<TGS_Package> AnyPipelinePackageAssets { get; private set; } = new List<TGS_Package>();
public void UpdateList()
{
SRPPackageAssets = packages.FindAll(p => p.targetPipeline == TGS_Package.Pipeline.SRP && p.hasPipelineDependancy);
URPPackageAssets = packages.FindAll(p => p.targetPipeline == TGS_Package.Pipeline.URP && p.hasPipelineDependancy);
HDRPPackageAssets = packages.FindAll(p => p.targetPipeline == TGS_Package.Pipeline.HDRP && p.hasPipelineDependancy);
AnyPipelinePackageAssets = packages.FindAll(p => !p.hasPipelineDependancy);
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 3dc42adeda0fd49428221fed59a896de
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 247241
packageName: Modular 3D Text - In-Game 3D UI System
packageVersion: 4.9.2
assetPath: Assets/Plugins/Tiny Giant Studio/Package Importer/TGS_Asset.cs
uploadId: 877966

View File

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

View File

@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 6f79915e40991514fbf72eca1c3d2968
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 247241
packageName: Modular 3D Text - In-Game 3D UI System
packageVersion: 4.9.2
assetPath: Assets/Plugins/Tiny Giant Studio/Package Importer/TGS_PackageImporter.asmdef
uploadId: 877966

View File

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

View File

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

View File

@@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: b4252425d332f1c43b241372d418ed5c
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
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
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 64
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: 64
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:
AssetOrigin:
serializedVersion: 1
productId: 247241
packageName: Modular 3D Text - In-Game 3D UI System
packageVersion: 4.9.2
assetPath: Assets/Plugins/Tiny Giant Studio/Package Importer/Utility/Editor Icons/Favicon.png
uploadId: 877966

View File

@@ -0,0 +1,117 @@
fileFormatVersion: 2
guid: c626ae484e0fb944db1906d266fc774a
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
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
cookieLightType: 1
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 1024
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: 1024
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:
AssetOrigin:
serializedVersion: 1
productId: 247241
packageName: Modular 3D Text - In-Game 3D UI System
packageVersion: 4.9.2
assetPath: Assets/Plugins/Tiny Giant Studio/Package Importer/Utility/Editor Icons/TGS
Logo.png
uploadId: 877966