This file contains 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.Linq; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.UI; | |
using UnityEngine.EventSystems; | |
// Handles moving, scaling and rotating UI objects using multitouch. | |
// Should be just about 1-1, as you'd expect on a touch screen, although because it applies deltas there's a bit of "slippage" if you manipulate the same object for a while/rapidly. | |
// To test multitouch with a mouse editor you can comment out the marked line in OnEndDrag. | |
public class MultitouchDraggable : Selectable, IBeginDragHandler, IEndDragHandler, IDragHandler { |
This file contains 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
[InitializeOnLoad] | |
public static class OnOpenUnityEditorExample { | |
const string lastCompileTimeKey = "InkIntegrationLastCompileTime"; | |
static InkEditorUtils () { | |
float lastCompileTime = LoadAndSaveLastCompileTime(); | |
if(EditorApplication.timeSinceStartup < lastCompileTime) | |
OnOpenUnityEditor(); | |
} | |
static void OnOpenUnityEditor () { |
This file contains 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
/// Used to draw custom inspectors for unrecognised file types, which Unity imports as "DefaultAsset" | |
/// To do this, create a new editor class extending DefaultAssetInspector | |
/// Return true in the IsValid function if the file extension of the file matches the type you'd like to draw. | |
/// The DefaultAssetEditor class will then hold a reference to the new instance of your editor class and call the appropriate methods for drawing. | |
/// An example can be found at the bottom of the file. | |
using UnityEngine; | |
using UnityEditor; | |
using System; | |
using System.IO; |
This file contains 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 UnityEditor; | |
using System.Collections; | |
public static class BetterPropertyField { | |
/// <summary> | |
/// Draws a serialized property (including children) fully, even if it's an instance of a custom serializable class. | |
/// Supersedes EditorGUILayout.PropertyField(serializedProperty, true); | |
/// </summary> | |
/// <param name="_serializedProperty">Serialized property.</param> |
This file contains 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
// Example usage - | |
// LoadableSprite loadableSprite = new LoadableSprite ("texture"); | |
// loadableSprite.LoadAsync (loadedSprite => { | |
// Do stuff on load here! | |
// }) | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
// You'll need to put this in your scene somewhere so the LoadableSprite class can use coroutines. |
This file contains 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; |
NewerOlder