Removed old Utils.

This commit is contained in:
2023-04-24 14:51:49 +02:00
parent 00ff703a1b
commit 8dcb16073c
6 changed files with 1 additions and 98 deletions

View File

@ -1,51 +0,0 @@
using System.IO;
using UnityEditor;
using UnityEngine;
namespace Utils
{
public class PackgeUpdater
{
private static string ManifestPath
{
get
{
var projectPath = Directory.GetParent(Application.dataPath).FullName;
var manifestPath = Path.Combine(projectPath, "Packages", "manifest.json");
return manifestPath;
}
}
public static string GetIdentifier(string input, char charFrom, char charTo)
{
var first = input.IndexOf(charFrom);
var second = input.IndexOf(charTo, first + 1);
var posFrom = input.IndexOf(charFrom, second + 1);
if (posFrom != -1) //if found char
{
var posTo = input.IndexOf(charTo, posFrom + 1);
if (posTo != -1) //if found char
{
return input.Substring(posFrom + 1, posTo - posFrom - 1);
}
}
return string.Empty;
}
[MenuItem("Assets/Update Git Packages", false, 1000)]
private static void UpdateGitPackages()
{
var lines = File.ReadAllLines(ManifestPath);
foreach (var line in lines)
{
if (line.Contains("git"))
{
var identifier = GetIdentifier(line, '"', '"');
Debug.Log("Checking for updates " + identifier);
UnityEditor.PackageManager.Client.Add(identifier);
}
}
}
}
}

View File

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