Removed old Utils.
This commit is contained in:
parent
00ff703a1b
commit
8dcb16073c
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ce75a6f4e95d89b4eba151eb7d16a6ff
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -9,5 +9,3 @@ Unity package with utility useful for almost any project.
|
||||
* Automatic volume based reflection probe placer.
|
||||
* Check how much time has passed with the Time Since struct.
|
||||
* Camera Blender controls in the scene view.
|
||||
* Package Manager Git updater.
|
||||
* Append to an array.
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6e14f8172d2e1b345bd36b974bcaeb61
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ru.shazbot.utils",
|
||||
"version": "5.0.0",
|
||||
"version": "5.1.0",
|
||||
"displayName": "Utils",
|
||||
"description": "Utility useful for almost any project.",
|
||||
"licensesUrl": "https://git.shazbot.ru/Utils.git/tree/LICENSE.md",
|
||||
|
Loading…
x
Reference in New Issue
Block a user