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
tell application "Finder" to set theFile to POSIX path of (selection as alias) | |
tell application "Finder" to set fileExtension to name extension of (selection as alias) |
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/UVTransform" { | |
Properties { | |
_MainTex ("Base (RGB)", 2D) = "white" {} | |
_TexScale ("Scale of Tex", Float) = 1.0 | |
_TexRatio ("Ratio of Tex", Float) = 1.0 | |
_Theta ("Rotation of Tex", Float) = 0.0 | |
_PlaneScale ("Scale of Plane Mesh", Vector) = (1, 1, 0, 0) | |
} |
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
/** | |
* Gradually changes a value towards a desired goal over time - implemented from Unity C# | |
*/ | |
public func smoothDamp(current c: CGFloat, target t: CGFloat, currentVelocity: inout CGFloat, smoothTime time: CGFloat, maxSpeed: CGFloat = CGFloat.infinity, deltaTime: CGFloat) -> CGFloat { | |
let smoothTime = max(0.0001, time) | |
let num = 2 / smoothTime | |
let num2 = num * deltaTime | |
let num3 = 1 / (1 + num2 + 0.48 * num2 * num2 + 0.235 * num2 * num2 * num2) | |
var num4 = c - t | |
let num5 = t |
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
public class UnityWebRequestAwaiter : INotifyCompletion | |
{ | |
private UnityWebRequestAsyncOperation asyncOp; | |
private Action continuation; | |
public UnityWebRequestAwaiter(UnityWebRequestAsyncOperation asyncOp) | |
{ | |
this.asyncOp = asyncOp; | |
asyncOp.completed += OnRequestCompleted; | |
} |
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.UI; | |
[RequireComponent(typeof(RectTransform), typeof(LayoutElement))] | |
[ExecuteInEditMode] | |
public class LayoutElementFitParent : MonoBehaviour | |
{ | |
[SerializeField] private float aspectRatio = 1; | |
[SerializeField] private bool updateMin = false; | |
[SerializeField] private bool updatePreferred = false; |
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
tell application "Unity" to activate -- needs to be in front | |
tell application "System Events" to tell application process "Unity" | |
try | |
get properties of window 1 | |
set size of window 1 to {1280, 720} | |
on error errmess | |
log errmess | |
-- no window open | |
end try | |
end tell |
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
varying vec2 hdConformedUV; | |
varying vec2 uv; | |
uniform sampler2D inputImage; | |
uniform int passIndex; | |
uniform vec2 uRenderSize; | |
uniform float uTime; | |
float random (in vec2 st) | |
{ | |
return fract(sin(dot(st.xy, vec2(12.9898,78.233)))* 43758.5453123); |
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
////////////////////////////////////////////////////////////////////////// | |
////////////////////////////////////////////////////////////////////////// | |
////////////////////////////////////////////////////////////////////////// | |
// Laser Focused | |
// Ben Ursu | Afrosquared | |
// Spark AR Studio | |
// Instagram | https://www.instagram.com/a/r/?effect_id=206763150244323 | |
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
const t = require('Time'); | |
const D = require('Diagnostics'); | |
const Scene = require('Scene'); | |
const objText = Scene.root.find('2dText0'); | |
let frame = 0; | |
const round = (val, precision = 1) => { | |
const multiplier = Math.pow(10, precision || 0); | |
return Math.round(val * multiplier) / multiplier; |
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
import { useRef } from 'react'; | |
const safeDocument: Document = document; | |
/** | |
* Usage: | |
* const [blockScroll, allowScroll] = useScrollBlock(); | |
*/ | |
export const useScrollBlock = (): [() => void, () => void] => { | |
const scrollBlocked = useRef(false); |
OlderNewer