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 System.Collections; | |
using System.Collections.Generic; | |
public static class MathUtilities{ | |
public static Vector2[] LineBoxIntersect(Vector2 point1, Vector2 point2, Rect rect) { | |
List<Vector2> intersect = new List<Vector2>(); //if this is ever greater than length 2 we have encountered a black hole | |
//order is clockwise from bottom left -> left edge, top edge, right edge, bottom edge | |
Vector2[] rectP1 = { | |
new Vector2(rect.xMin, rect.yMin), //bottom left |
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.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class SmoothFKMember : MonoBehaviour { | |
public Transform fkParent; | |
public float rotationSpeed = 10f; | |
private Vector3 initialPositionOffset; |
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.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class BloomFilter : MonoBehaviour { | |
[Range(1, 16)] | |
public int iterations = 1; | |
[Range(0f, 1f)] | |
public float threshold = 0.8f; | |
[Range(0f, 1f)] |
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 "Unlit/BillboardColor" { | |
Properties{ | |
_Color("_Color", Color) = (1,1,1,1) | |
} | |
SubShader{ | |
Tags{ "RenderType" = "Transparent" "Queue" = "Transparent" } |
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.IO; | |
using System; | |
using UnityEngine; | |
using UnityEditor; | |
using Debug = UnityEngine.Debug; | |
public class ComputeRenderer : EditorWindow { | |
public RenderTexture previewTexture; |
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 System.Collections.Generic; | |
public static class LayerMaskExtensions { | |
// int extensions | |
public static int Inverse(this int mask) { | |
return ~mask; | |
} | |
public static int Combined(this int mask, int other) { | |
return mask | other; |
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 "Custom/Unlit/CrescentAnimation" | |
{ | |
Properties | |
{ | |
[PerInstanceData] _Anim ("Animation", Range(0, 1)) = 0 | |
[PerInstanceData] _Flash ("Flash", Range(0, 1)) = 0 | |
[PerInstanceData] _Color ("Color", Color) = (1,1,1,1) | |
[PerInstanceData] _OffsetDir ("Offset Direction", Vector) = (0.5, 0.5, 0, 0) | |
_Displacement ("Displacement", Float) = 0.65 |
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; | |
public class ContiguousMap<T> { | |
int[] _idIndexMap; | |
int[] _idPool; | |
int _poolCount = 0; | |
int _nextId = 0; | |
public T[] values { | |
get { return _values; } | |
} |
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
#include <stdlib.h> | |
#include <stdio.h> | |
#include "sparseset.h" | |
int min(int a, int b) { | |
return a < b ? a : b; | |
} | |
int max(int a, int b) { | |
return a > b ? a : b; | |
} |
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
// | |
// CenteredCollectionViewFlowLayout.swift | |
// ACameraAppwithBlur | |
// | |
// Created by Sam Loeschen on 5/30/20. | |
// Copyright © 2020 Sam Loeschen. All rights reserved. | |
// | |
import Foundation | |
import UIKit |
OlderNewer