Removed old Utils.

This commit is contained in:
Alexander Filippov 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:

View File

@ -9,5 +9,3 @@ Unity package with utility useful for almost any project.
* Automatic volume based reflection probe placer. * Automatic volume based reflection probe placer.
* Check how much time has passed with the Time Since struct. * Check how much time has passed with the Time Since struct.
* Camera Blender controls in the scene view. * Camera Blender controls in the scene view.
* Package Manager Git updater.
* Append to an array.

View File

@ -1,22 +0,0 @@
namespace Utils
{
public static class ArrayExtensions
{
public static T[] Append<T>(this T[] array, T item)
{
if (array == null)
{
return new T[] { item };
}
var result = new T[array.Length + 1];
for (var i = 0; i < array.Length; i++)
{
result[i] = array[i];
}
result[array.Length] = item;
return result;
}
}
}

View File

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

View File

@ -1,6 +1,6 @@
{ {
"name": "ru.shazbot.utils", "name": "ru.shazbot.utils",
"version": "5.0.0", "version": "5.1.0",
"displayName": "Utils", "displayName": "Utils",
"description": "Utility useful for almost any project.", "description": "Utility useful for almost any project.",
"licensesUrl": "https://git.shazbot.ru/Utils.git/tree/LICENSE.md", "licensesUrl": "https://git.shazbot.ru/Utils.git/tree/LICENSE.md",