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
lexer grammar HlslAntlrLexer; | |
@lexer::header {#pragma warning disable 3021} | |
AppendStructuredBuffer : 'AppendStructuredBuffer'; | |
Bool : 'bool'; | |
Bool1 : 'bool1'; | |
Bool2 : 'bool2'; | |
Bool3 : 'bool3'; | |
Bool4 : 'bool4'; |
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
private static void ShareImageWithTextOnAndroid(string message, string imageFilePath) | |
{ | |
AndroidJavaClass intentClass = new AndroidJavaClass("android.content.Intent"); | |
AndroidJavaObject intentObject = new AndroidJavaObject("android.content.Intent"); | |
intentObject.Call<AndroidJavaObject>("setAction", intentClass.GetStatic<string>("ACTION_SEND")); | |
AndroidJavaClass uriClass = new AndroidJavaClass("android.net.Uri"); | |
AndroidJavaObject uriObject = uriClass.CallStatic<AndroidJavaObject>("parse", "file://" + imageFilePath); | |
intentObject.Call<AndroidJavaObject>("putExtra", intentClass.GetStatic<string>("EXTRA_STREAM"), uriObject); | |
intentObject.Call<AndroidJavaObject>("putExtra", intentClass.GetStatic<string>("EXTRA_TEXT"), message); |
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.Rendering; | |
// This script is added to cameras automatically at runtime by the ObjectNeedingRefraction scripts. | |
public class CameraTrackingRefraction : MonoBehaviour { | |
[System.NonSerialized] | |
public int lastRenderedFrame = -1; | |
Camera cam; |
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.Generic; | |
using UnityEngine; | |
public static class SortedGizmos | |
{ | |
static List<ICommand> commands = new List<ICommand>(1000); | |
public static Color color { get; set; } |
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 UnityEditor; | |
using UnityEditorInternal; | |
namespace MK.Utilities | |
{ | |
public class TextureArrayCreator : ScriptableWizard | |
{ | |
[MenuItem("Window/Texture Array Creator")] |
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 Unity.Collections; | |
using Unity.Collections.LowLevel.Unsafe; | |
namespace ARKitStream.Internal | |
{ | |
public static class NativeArrayExtension | |
{ | |
public static byte[] ToRawBytes<T>(this NativeArray<T> arr) where T : struct | |
{ | |
var slice = new NativeSlice<T>(arr).SliceConvert<byte>(); |
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
Shader "Custom/UnlitTexture" | |
{ | |
Properties | |
{ | |
[MainColor] _BaseColor("BaseColor", Color) = (1,1,1,1) | |
[MainTexture] _BaseMap("BaseMap", 2D) = "white" {} | |
} | |
// Universal Render Pipeline subshader. If URP is installed this will be used. | |
SubShader |
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.Diagnostics; | |
using Unity.Burst; | |
using Unity.Collections; | |
using Unity.Collections.LowLevel.Unsafe; | |
using Unity.Jobs.LowLevel.Unsafe; | |
using Unity.Mathematics; | |
using UnityEditor; | |
using Debug = UnityEngine.Debug; | |
using System.Runtime.CompilerServices; |
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 UnityEditor; | |
using System.Reflection; | |
using System; | |
// This class finds and kills a coroutine that throws errors inside the editor every 5 seconds if no headset is connected | |
// The coroutine was introduced in the OpenXR Plugin [1.5.1] - 2022-08-11 | |
// There absolutely has to be a better way, and this code should NOT be maintained incase the issue is resolved | |
public class OpenXRRestarterKiller : MonoBehaviour { | |
private static bool isHookedIntoUpdate = false; |