Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcusotter/useful-unity
A collection of my helper methods and extensions for Unity3d development
https://github.com/marcusotter/useful-unity
Last synced: 14 days ago
JSON representation
A collection of my helper methods and extensions for Unity3d development
- Host: GitHub
- URL: https://github.com/marcusotter/useful-unity
- Owner: MarcusOtter
- License: agpl-3.0
- Created: 2022-06-29T23:22:07.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-30T00:55:49.000Z (about 1 year ago)
- Last Synced: 2024-10-09T00:41:29.008Z (about 1 month ago)
- Language: C#
- Homepage:
- Size: 17.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# useful-unity
A collection of my helper methods and extensions for Unity3d developmentUse this script to import it (WIP)
```cs
using System;
using System.Linq;
using System.Threading.Tasks;
using UnityEditor;
using UnityEditor.PackageManager;
using UnityEngine;public class ImportUsefulUnityEditor : Editor
{
private const string url = "https://github.com/MarcusOtter/useful-unity.git";
private const int timeoutMs = 5000;
[MenuItem("Assets/Update MarcusOtter⧸useful-unity")]
public static async void ShowWindow()
{
var request = Client.Add(url);if (request.Status == StatusCode.InProgress)
{
Debug.Log("Adding or updating MarcusOtter/useful-unity...");var elapsed = 0;
while (request.Status == StatusCode.InProgress || elapsed > timeoutMs)
{
await Task.Delay(100);
elapsed += 100;
EditorUtility.DisplayProgressBar("Importing MarcusOtter/useful-unity", "Please wait...", elapsed / (float)timeoutMs);
}
EditorUtility.ClearProgressBar();
}
if (request.Status == StatusCode.Success)
{
Debug.Log("Successfully added or updated MarcusOtter/useful-unity");
}
else if (request.Status == StatusCode.Failure)
{
var errorMessages = request.Result?.errors?.Select(x => x?.message ?? "") ?? Array.Empty();
Debug.LogError("Failed to add or update MarcusOtter/useful-unity\n" + string.Join("\n", errorMessages));
}
}
}```