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
// | |
// Screen space based depth outline. No post processing setup needed. | |
// | |
// - Enable Depth Buffer on URP settings. | |
// - Put any geometry with this shader (like a Quad) in front of geometry. | |
// - Voila. | |
// | |
// This shader is based on the work of Mirza Beig. | |
// https://github.com/MirzaBeig/Post-Processing-Wireframe-Outlines | |
// |
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.Generic; | |
using UnityEngine; | |
using UnityEngine.UI; | |
// Text2 extends the Text component in Unity UI. | |
// It makes hyphens and soft hyphens work. | |
// Inserting soft hyphens in text can be tricky and confusing, given they are invisible, | |
// so you can instead also insert Hyphenation Point characters, which will be replaced by soft hyphens: | |
// https://www.compart.com/en/unicode/U+2027 | |
public class Text2 : Text { |
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
/// <summary> | |
/// Computes a point for a gun to aim at in order to hit a target using linear prediction. | |
/// Assumes a bullet with no gravity or drag. I.e. A bullet that maintains a constant | |
/// velocity after it's been fired. | |
/// </summary> | |
public static Vector3 ComputeGunLead(Vector3 targetPos, Vector3 targetVel, Vector3 ownPos, Vector3 ownVel, float muzzleVelocity) | |
{ | |
// Extremely low muzzle velocities are unlikely to ever hit. This also prevents a | |
// possible division by zero if the muzzle velocity is zero for whatever reason. | |
if (muzzleVelocity < 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
using System.Reflection; | |
using UnityEngine; | |
using UnityEngine.Rendering; | |
using UnityEngine.Rendering.Universal; | |
using ShadowResolution = UnityEngine.Rendering.Universal.ShadowResolution; | |
/// <summary> | |
/// Enables getting/setting URP graphics settings properties that don't have built-in getters and setters. |
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
global.THREE = require("three"); | |
const canvasSketch = require('canvas-sketch'); | |
const Random = require('canvas-sketch-util/random'); | |
const gradientHeight = 512; | |
const settings = { | |
dimensions: [ 2048, gradientHeight * 2 ] | |
}; |
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
extends Spatial | |
var _materials := [] | |
var _process_materials := [] | |
var _count := 0 | |
func _ready() -> void: | |
_find_all_materials("res://") | |
print(_process_materials) |
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 MeshBlit : MonoBehaviour | |
{ | |
public RenderTexture rt; | |
public Mesh mesh; | |
public Material material; | |
public Vector3 meshPosition = new Vector3(0.5f, 0.5f, -1); |
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; | |
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 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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Reflection; | |
using System.Text.RegularExpressions; | |
using UnityEditor; | |
using UnityEngine; | |
/// <summary> | |
/// Generates a boilerplate custom inspector script for Monobehaviours and populates it with its serialized fields. |
NewerOlder