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
[JobProducerType(typeof(JobCustomParallelExtensions.JobCustomParallelStruct<>))] | |
public interface IJobCustomParallel | |
{ | |
void Execute(); | |
} | |
public static class JobCustomParallelExtensions | |
{ | |
public static void EarlyJobInit<T>() where T : struct, IJobCustomParallel | |
{ |
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
[JobProducerType(typeof(JobCustomSingleExtensions.JobCustomSingleStruct<>))] | |
public interface IJobCustomSingle | |
{ | |
void Execute(); | |
} | |
public static class JobCustomSingleExtensions | |
{ | |
public static void EarlyJobInit<T>() where T : struct, IJobCustomSingle | |
{ |
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 |
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
[Il2CppSetOption(Option.DivideByZeroChecks, false)] | |
[StructLayout(LayoutKind.Sequential, Pack = 2)] | |
[DebuggerDisplay("Value = {Value}")] | |
public readonly struct SomeId : IEquatable<SomeId> | |
{ | |
public static readonly SomeId Invalid = new SomeId(-1); | |
public static readonly SomeId Zero = new SomeId(0); | |
public readonly short Value; |
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
// 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 |