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 UnityEditor; | |
using UnityEditor.SceneManagement; | |
using UnityEngine; | |
public static class StencilOnPreviewMaterials { | |
[InitializeOnLoadMethod] | |
private static void Init() { | |
Camera.onPreCull += OnPreCull; | |
} |
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.Runtime.CompilerServices; | |
using Unity.Collections; | |
public static class MutableNativeContainer { | |
[MethodImpl(MethodImplOptions.AggressiveInlining)] | |
public unsafe static ref T GetMutable<T>(this NativeArray<T> arr, int index) where T : unmanaged { | |
return ref ArrayElement<T>(arr.m_Buffer, index); | |
} | |
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
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; | |
using System.Reflection; | |
using UnityEditor; | |
using UnityEngine; | |
[CustomEditor(typeof(SomeSMB))] | |
public class SomeSMBEditor : Editor { | |
public override void OnInspectorGUI() { | |
Type animatorWindowType = Type.GetType("UnityEditor.Graphs.AnimatorControllerTool, UnityEditor.Graphs"); | |
var window = EditorWindow.GetWindow(animatorWindowType); |
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
Type animatorWindowType = Type.GetType("UnityEditor.Graphs.AnimatorControllerTool, UnityEditor.Graphs"); | |
var window = EditorWindow.GetWindow(animatorWindowType); | |
window.Show(); |
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.Reflection; | |
using UnityEditor; | |
using UnityEngine; | |
[InitializeOnLoad] | |
public class EditorCameraSpeed | |
: EditorWindow { | |
[MenuItem("Tools/Camera Speed &S")] | |
public static void CameraSpeed() { | |
var window = GetWindow<EditorCameraSpeed>(); |
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
// c# companion script | |
// SpriteUVToShader.cs -------------------------------------------------------------------------------------------------------------------------------- // | |
// Save you your project, add to your SpriteRenderer gameObject | |
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
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; | |
using System.Runtime.InteropServices; | |
namespace Ashkatchap.BitUtils { | |
public enum Endianness { | |
/// <summary> | |
/// Network Byte order | |
/// </summary> | |
Big = 0, | |
/// <summary> |
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
// callback takes one argument | |
// http://stackoverflow.com/questions/8567114/how-to-make-an-ajax-call-without-jquery | |
// data = null or undefined para usar GET | |
AJAX = function(url, data, callbackOK, callbackFAIL, timeout) { | |
if (callbackFAIL === undefined) callbackFAIL = function(x){}; | |
if (callbackOK === undefined) callbackOK = function(x){}; | |
if (isNaN(timeout)) timeout = 30000; | |
var isPost = data !== undefined && data !== null; | |
var x = new XMLHttpRequest(); | |
if (isPost) x.open('POST', url, true); |
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; | |
using System.IO; | |
class Program { | |
static void Main(string[] args) { | |
Console.WriteLine("Close this window when you are finished doing cool progress"); | |
Console.WriteLine("first argument: path to Library folder"); | |
// Path | |
string path = new FileInfo(System.Reflection.Assembly.GetEntryAssembly().Location).Directory.FullName; |
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
Shader "Mattatz/SobelFilter" { | |
Properties { | |
_MainTex ("Base (RGB)", 2D) = "white" {} | |
_DeltaX ("Delta X", Float) = 0.01 | |
_DeltaY ("Delta Y", Float) = 0.01 | |
} | |
SubShader { | |
Tags { "RenderType"="Opaque" } |