Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using System.IO;
- using System.Net.Http;
- using UnityEditor;
- using UnityEngine;
- namespace JasonStorey
- {
- public static class GetJasonsHelp
- {
- [MenuItem("Help/Help me Jason!", false,-1000)]
- public static async void Help()
- {
- if (!EditorUtility.DisplayDialog("Let's do this!", "Are you sure?", "Let's go!", "I changed my mind..."))
- return;
- Debug.Log("<color=green>HERE IT COMES!</color>");
- using var client = new HttpClient();
- Debug.Log("Downloading <color=yellow>Editor Hacks</color>");
- var response =
- await client.GetAsync($"https://gist.githubusercontent.com/jason-storey/f37fe085bd10dea13e7e39df34c072f2/raw");
- var content = await response.Content.ReadAsStringAsync();
- var filePath = Path.Combine(Application.dataPath, "JasonsEditorHacks.cs");
- Debug.Log("Adding them to Unity!");
- await File.WriteAllTextAsync(filePath,content);
- AssetDatabase.Refresh();
- Debug.Log("Ok!, Now, go to <color=blue>SETUP</color> menu now at the top of the editor to <color=green>really</color> get started.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement