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.Linq; | |
using System.Text.RegularExpressions; | |
public static class IdentifierExtensions | |
{ | |
// definition of a valid C# identifier: http://msdn.microsoft.com/en-us/library/aa664670(v=vs.71).aspx | |
private const string FORMATTING_CHARACTER = @"\p{Cf}"; | |
private const string CONNECTING_CHARACTER = @"\p{Pc}"; | |
private const string DECIMAL_DIGIT_CHARACTER = @"\p{Nd}"; |
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
Windows Registry Editor Version 5.00 | |
[HKEY_CLASSES_ROOT\Folder\shell\Unity5] | |
@="" | |
"Icon"="%ProgramFiles%\\Unity\\Editor\\Unity.exe" | |
"MUIVerb"="Open as Unity Project" | |
[HKEY_CLASSES_ROOT\Folder\shell\Unity5\Command] | |
@="cmd /c start /D\"c:\\Program Files\\Unity\\Editor\\\" Unity.exe -projectPath \"%1\"" |
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; | |
/// <summary> | |
/// GameビューにてSceneビューのようなカメラの動きをマウス操作によって実現する | |
/// </summary> | |
[RequireComponent(typeof(Camera))] | |
public class SceneViewCamera : MonoBehaviour | |
{ | |
[SerializeField, Range(0.1f, 10f)] | |
private float wheelSpeed = 1f; |
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
ScriptableObject Icon | |
_Popup | |
_Help | |
Clipboard | |
SocialNetworks.UDNOpen | |
SocialNetworks.Tweet | |
SocialNetworks.FacebookShare | |
SocialNetworks.LinkedInShare | |
SocialNetworks.UDNLogo | |
animationvisibilitytoggleoff |
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 void ShowToast(string text) | |
{ | |
if (Application.platform == RuntimePlatform.Android) | |
{ | |
AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); | |
AndroidJavaObject activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity"); | |
activity.Call("runOnUiThread", new AndroidJavaRunnable( | |
()=> | |
{ |
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
/// | |
/// Draw lines at runtime | |
/// by Nothke | |
/// unlicensed, aka do whatever you want with it | |
/// made during Stugan 2016 :) | |
/// ..(it's midnight, and Robbie clicks A LOT, LOUDLY!) | |
/// | |
/// Important: | |
/// - Should be called in OnPostRender() (after everything else has been drawn) | |
/// therefore the script that calls it must be attached to the camera |
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
/* | |
Basic Sprite Shader for aligning pixel art to the same grid, based on the Unity Sprite Shader. | |
Create one Material where you assign the same Pixels Per Unit value you use on your imported Sprites, | |
then reuse this Material on all appropriate Sprite Renderers. | |
(You can use Shader.SetGlobalFloat to set that Pixels Per Unit value for all your shaders: | |
https://docs.unity3d.com/ScriptReference/Shader.SetGlobalFloat.html) | |
This is not for scaled or rotated artwork. If you need those features, look at low res render textures. | |
Use this however you want. |
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.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.EventSystems; | |
using UnityEngine.UI; | |
[RequireComponent(typeof(ScrollRect))] | |
[AddComponentMenu("UI/ScrollRect Auto-Scroll")] | |
public class ScrollRectAutoScroll : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler | |
{ | |
public float scrollSpeed = 10f; | |
private bool mouseOver = false; |
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.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.EventSystems; | |
public class EventSystemManaged : EventSystem | |
{ | |
static Stack<EventSystem> ms_PrevEventSystem = new Stack<EventSystem>(); | |
static bool ms_Forced = false; | |
protected override void OnEnable() |
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
#!/bin/bash | |
# usage: send path of an asset in. the script will find the GUID from the associated meta file, and look for usages of this GUID anywhere. | |
# of course only works with text mode (YAML) serialization | |
GUID=$(grep -Po '(?<=guid: )\w+' $1.meta) | |
echo "Object has GUID $GUID" | |
echo "Searching for instances..." | |
find . \( -name "*.asset" -o -name "*.prefab" -o -name "*.unity" \) -exec grep -l $GUID {} \; |
OlderNewer