In this page:
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 UnityEngine; | |
using UnityEngine.LowLevel; | |
using UnityEngine.PlayerLoop; | |
public static class PlayerLoopCleaner | |
{ | |
private static readonly Type[] typesToRemove = new Type[] { | |
typeof(EarlyUpdate.Physics2DEarlyUpdate), | |
// Physics 2D |
The collections provided by this package fall into three categories:
- The collection types in
Unity.Collections
whose names start withNative-
have safety checks for ensuring that they're properly disposed and are used in a thread-safe manner. - The collection types in
Unity.Collections.LowLevel.Unsafe
whose names start withUnsafe-
do not have these safety checks. - The remaining collection types are not allocated and contain no pointers, so effectively their disposal and thread safety are never a concern. These types hold only small amounts of data.
Most of the methods in Mathematics have many overloads for different combinations of types. For example, math.abs()
takes vector arguments, not just scalars, e.g. math.abs(new int3(5, -7, -1))
returns new int3(5, 7, 1)
. This cheat sheet does not exhaustively demonstrate all of the overloads. Consult the API reference for the full list.
In this page:
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
#if UNITY_5_3_OR_NEWER | |
#define NOESIS | |
using Noesis; | |
#else | |
using System.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Media; | |
#endif | |
namespace NoesisGUI.Extensions.Scaling |
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 UnityEngine.Rendering; | |
using UnityEngine.Rendering.LWRP; | |
// Inheriting from `ScriptableRendererFeature` will add it to the | |
// `Renderer Features` list of the custom LWRP renderer data asset. | |
public class RenderMyCustomPass : ScriptableRendererFeature | |
{ | |
private class MyCustomPass : ScriptableRenderPass | |
{ |
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
fixed3 Darken (fixed3 a, fixed3 b) | |
{ | |
return min(a, b); | |
} | |
fixed3 Multiply (fixed3 a, fixed3 b) | |
{ | |
return a * b; | |
} |