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 UnityEditor; | |
[CustomEditor (typeof(TriggerContainer))] | |
public class TriggerContainerEditor : Editor | |
{ | |
private SerializedObject obj; |
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; | |
/* | |
* Most functions taken from Tween.js - Licensed under the MIT license | |
* at https://github.com/sole/tween.js | |
* Quadratic.Bezier by @fonserbc - Licensed under WTFPL license | |
*/ | |
public delegate float EasingFunction(float k); | |
public class Easing |
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
ScriptableObject Icon | |
_Popup | |
_Help | |
Clipboard | |
SocialNetworks.UDNOpen | |
SocialNetworks.Tweet | |
SocialNetworks.FacebookShare | |
SocialNetworks.LinkedInShare | |
SocialNetworks.UDNLogo | |
animationvisibilitytoggleoff |
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
/// | |
/// Draw lines at runtime | |
/// by Nothke | |
/// unlicensed, aka do whatever you want with it | |
/// made during Stugan 2016 :) | |
/// ..(it's midnight, and Robbie clicks A LOT, LOUDLY!) | |
/// | |
/// Important: | |
/// - Should be called in OnPostRender() (after everything else has been drawn) | |
/// therefore the script that calls it must be attached to the camera |
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
float3 CalcGerstnerWaveNormal(float3 P) | |
{ | |
float3 normal = float3(0, 1, 0); | |
[unroll] | |
for (int i = 0; i < numWaves; i++) | |
{ | |
Wave wave = waves[i]; | |
float wi = 2 / wave.waveLength; | |
float WA = wi * wave.amplitude; | |
float phi = speed * wi; |
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
// When creating shaders for Universal Render Pipeline you can you the ShaderGraph which is super AWESOME! | |
// However, if you want to author shaders in shading language you can use this teamplate as a base. | |
// Please note, this shader does not necessarily match perfomance of the built-in URP Lit shader. | |
// This shader works with URP 7.1.x and above | |
Shader "Universal Render Pipeline/Custom/Physically Based Example" | |
{ | |
Properties | |
{ | |
// Specular vs Metallic workflow | |
[HideInInspector] _WorkflowMode("WorkflowMode", Float) = 1.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
using Unity.Collections; | |
using Unity.Collections.LowLevel.Unsafe; | |
using Unity.Mathematics; | |
using UnityEngine; | |
public class NativeMeshTest : MonoBehaviour | |
{ | |
private NativeArray<float3> vertexBuffer; | |
private Vector3[] vertexArray; |
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
// | |
// Simplex noise custom node for Shader Graph | |
// | |
// Original work (webgl-noise) Copyright (C) 2011 Ashima Arts. | |
// Translation and modification was made by Keijiro Takahashi. | |
// Ported to Shader Graph by Sergio L. Valladares | |
// | |
// This shader is based on the webgl-noise GLSL shader. For further details | |
// of the original shader, please see the following description from the | |
// original source code. |
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
// example of how to move a current value towards a target value at a constant speed | |
// without going over the target value | |
// formula is the same for vectors of any dimension | |
Vector3 Seek(Vector3 currentValue, Vector3 targetValue, float maxSpeed, float dt) | |
{ | |
// delta/difference from current value to target value | |
Vector3 delta = targetValue - currentValue; | |
// don't take the square root of magnitude yet | |
// so we can potentially early out on degenerate case of currenvValue ~= targetValue |
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; | |
public class LengthTable { | |
public float[] distances; | |
int SmpCount => distances.Length; | |
float TotalLength => distances[SmpCount - 1]; | |
public LengthTable( OrientedCubicBezier3D bezier, int precision = 16 ) { | |
distances = new float[precision]; |
OlderNewer