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 UnityEngine; | |
#if UNITY_EDITOR | |
using UnityEditor; | |
#endif | |
[Serializable] | |
public class EnumArray<E, T> : ISerializationCallbackReceiver where E : Enum | |
{ | |
public static readonly int s_Length; |
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 Unity.Burst; | |
using Unity.Collections; | |
using Unity.Collections.LowLevel.Unsafe; | |
using Unity.Jobs; | |
using UnityEngine; | |
// This example code demonstrates using Unity Burst directly on a static method without jobs. | |
// Unity NativeArrays can't be used directly in Unity Burst methods (only in Burst jobs), | |
// so we have to pass pointers to arrays instead. |
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
// MIT License | |
// | |
// Copyright (c) 2023 Voxel Plugin | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
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
struct vec3f {float x, y, z;}; | |
struct vec4f {float x, y, z, w;}; | |
struct mat44f {vec4f x, y, z, w;}; | |
//============================================================================ | |
// sphere_screen_extents | |
//============================================================================ | |
// Calculates the exact screen extents xyzw=[left, bottom, right, top] in | |
// normalized screen coordinates [-1, 1] for a sphere in view space. For | |
// performance, the projection matrix (v2p) is assumed to be setup so that |
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 "Name" { | |
Properties { | |
_Name ("display name", Range (min, max)) = number | |
_Name ("display name", Float) = number | |
_Name ("display name", Int) = number | |
_Name ("display name", Color) = (number,number,number,number) | |
_Name ("display name", Vector) = (number,number,number,number) |