Skip to content

Commit

Permalink
2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Yunasawa committed Oct 1, 2024
1 parent 7d5ecf7 commit 0e24ff1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
4 changes: 1 addition & 3 deletions Editor/Setups/YNL-Editor.Packages.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if !YNL_CREATOR
using System.Collections.Generic;
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.PackageManager;
using UnityEditor.PackageManager.Requests;
Expand Down Expand Up @@ -254,4 +253,3 @@ public PackageBox(string label, bool status)
}
}
}
#endif
22 changes: 15 additions & 7 deletions Editor/Setups/YNL-Editor.Setups.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
#if !YNL_CREATOR
using UnityEditor;
using UnityEditor.PackageManager.Requests;
using UnityEditor.PackageManager;
using YNL.Editors.Setups;
using UnityEngine;
using System.Linq;

namespace YNL.Editors.Setups
{
[InitializeOnLoad]
public class Setups
public class Setups : AssetPostprocessor
{
public const string DependenciesKey = "YNL - Editor | dependencies";

private static ListRequest _request;
public static bool Dependencies;

static Setups()
private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
{
EditorApplication.update += OnEditorApplicationUpdate;
var inPackages = importedAssets.Any(path => path.StartsWith("Packages/")) ||
deletedAssets.Any(path => path.StartsWith("Packages/")) ||
movedAssets.Any(path => path.StartsWith("Packages/")) ||
movedFromAssetPaths.Any(path => path.StartsWith("Packages/"));

if (inPackages)
{
EditorApplication.update += OnEditorApplicationUpdate;
}
}

private static void OnEditorApplicationUpdate()
Expand All @@ -40,6 +47,8 @@ private static void OnEditorApplicationUpdate()
EditorPrefs.SetBool(DependenciesKey, true);

EditorDefineSymbols.AddSymbols("YNL_EDITOR");

Debug.Log("YNL - Editor");
}

private static void IsPackageInstalled(PackageCollection packages, string name, ref bool checker)
Expand All @@ -53,4 +62,3 @@ private static void IsPackageInstalled(PackageCollection packages, string name,
}
}
}
#endif
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.yunasawa.ynl.editor",
"displayName": "YNL - Editor",
"version": "2.0.17",
"version": "2.1.0",
"unity": "2022.3",
"description": "Enhance your Unity Editor experience with this library. It provides essential extensions and interfaces specifically designed for the Editor environment.",
"keywords": [
Expand Down

0 comments on commit 0e24ff1

Please sign in to comment.