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; | |
public class CornerCheat : MonoBehaviour { | |
public CircleCollider2D circle; | |
public Rigidbody2D body; | |
EdgeCollider2D edge; | |
[Range(0, .2f)] public float distanceThreshold = .03f; | |
[Range(0, 1)] public float dotThreshold = .96f; |
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.IO; | |
using UnityEditor; | |
using UnityEngine; | |
using System.Linq; | |
using System.Threading.Tasks; | |
public class UnityUtils: MonoBehaviour | |
{ | |
[MenuItem("Tools/Find Broken GUIDs")] |
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; | |
public class CustomParticleCulling : MonoBehaviour | |
{ | |
public float cullingRadius = 10; | |
public ParticleSystem target; | |
CullingGroup m_CullingGroup; | |
Renderer[] m_ParticleRenderers; |
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 "Milkbag/CurvatureImageEffect" | |
{ | |
Properties | |
{ | |
_MainTex ("Texture", 2D) = "white" {} | |
_LightStrength ("LightStrength", Float) = 0.3 | |
_DarkStrength ("DarkStrength", Float) = 0.3 | |
_Spread ("Spread", Float) = 1.0 | |
[Toggle(USE_MULTIPLY)] _UseMultiply("Use Multiply", Float) = 0 | |
[Toggle(CURVATURE_ONLY)] _CurvatureOnly("Curvature Only", Float) = 0 |
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
// | |
// 1. Add a Quad in Unity | |
// 2. Parent the quad under camera, to prevent frustum culling. | |
// 3. Attach this shader. | |
// | |
Shader "Quad/Fullscreen" | |
{ | |
Properties | |
{ | |
} |
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
// source https://gist.github.com/Su-s/438be493ae692318c73e30367cbc5c2a | |
using System; | |
using System.IO; | |
using System.IO.Compression; | |
using System.Text; | |
namespace TarLib | |
{ | |
public class Tar |
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 TMPro; | |
using UnityEngine; | |
[RequireComponent(typeof(TextMeshProUGUI))] | |
public class BuildDisplayer : MonoBehaviour | |
{ | |
private TextMeshProUGUI Text; | |
private void Awake() | |
{ |
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 System.Linq; | |
using System.Text; | |
using UnityEngine; | |
/// <summary> | |
/// A simple free camera to be added to a Unity game object. | |
/// | |
/// Keys: |
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 "Test/SmoothZoomTexture" | |
{ | |
Properties | |
{ | |
_MainTex ("Texture", 2D) = "white" {} | |
[KeywordEnum(Basic,Manual,Blend,Compare)]Mode("Mode", Int) = 0 | |
_Blend("Blend", Range(0,1)) = 1 | |
[Header(Mip Map)] | |
_MipMapMin("MipMap Min", Int) = 4 |
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
#ifndef __MATRIX_INCLUDED__ | |
#define __MATRIX_INCLUDED__ | |
#define IDENTITY_MATRIX float4x4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1) | |
float4x4 inverse(float4x4 m) { | |
float n11 = m[0][0], n12 = m[1][0], n13 = m[2][0], n14 = m[3][0]; | |
float n21 = m[0][1], n22 = m[1][1], n23 = m[2][1], n24 = m[3][1]; | |
float n31 = m[0][2], n32 = m[1][2], n33 = m[2][2], n34 = m[3][2]; | |
float n41 = m[0][3], n42 = m[1][3], n43 = m[2][3], n44 = m[3][3]; |