This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Developed by Tom Kail at Inkle | |
| // Released under the MIT Licence as held at https://opensource.org/licenses/MIT | |
| // Must be placed within a folder named "Editor" | |
| using System; | |
| using System.Reflection; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| using UnityEditor; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using System; | |
| using System.Reflection; | |
| using System.Text.RegularExpressions; | |
| [AttributeUsage (AttributeTargets.Field,Inherited = true)] | |
| public class ReadOnlyAttribute : PropertyAttribute {} | |
| #if UNITY_EDITOR | |
| [UnityEditor.CustomPropertyDrawer (typeof(ReadOnlyAttribute))] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class UrlDownloader | |
| { | |
| public static void DownloadText(string url, Action<string> callback); | |
| } | |
| // Brute force way of doing it | |
| IEnumerator MyAsyncFunction() | |
| { | |
| var done = false; | |
| var result = default(string); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using UnityEngine.UI; | |
| public static class ScrollRectExtensions | |
| { | |
| /// <summary> | |
| /// Tell the Scroll Rect View to snap to the given element (top). | |
| /// </summary> | |
| public static void SnapTo( | |
| this ScrollRect scrollRect, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static class TouchHelper | |
| { | |
| // OG version: https://www.reddit.com/r/Unity3D/comments/6o9zsy/comment/dkgxa1i/?utm_source=share&utm_medium=web2x&context=3 | |
| public static bool IsOverUI() | |
| { | |
| PointerEventData pointerData = new PointerEventData(EventSystem.current); | |
| pointerData.position = Input.mousePosition; | |
| List<RaycastResult> results = new List<RaycastResult>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using UnityEngine; | |
| using System.Collections.Generic; | |
| public static class EventManager<T> | |
| { | |
| private static readonly List<Action<T>> _listeners = new List<Action<T>>(8); | |
| public static void AddListener(Action<T> handler) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class ExtensionMethods | |
| { | |
| public static TaskAwaiter GetAwaiter(this AsyncOperation asyncOp) | |
| { | |
| var tcs = new TaskCompletionSource<object>(); | |
| asyncOp.completed += obj => { tcs.SetResult(null); }; | |
| return ((Task)tcs.Task).GetAwaiter(); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using System.IO; | |
| using System.Security.Cryptography; | |
| using System.Text; | |
| using UnityEngine; | |
| using UnityEngine.Networking; | |
| using static UnityEngine.Networking.UnityWebRequest.Result; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Globalization; | |
| using System.Security.Cryptography; | |
| using System.Text; | |
| using UnityEngine; | |
| public static class SecurePlayerPrefs | |
| { | |
| private static readonly string _encryptionKey = DeriveKey(); |