// src*: https://gist.github.com/andrew-raphael-lukasik/d2903247b3f9c94e6faa9c042d9f0460/
#if UNITY_EDITOR
[UnityEditor.MenuItem( "Tools/Fix All Terrain Seams" )]
static void FixAllSeams () { FixTerrains( Object.FindObjectsOfType<Terrain>() ); }
#endif
static void FixTerrains ( Terrain[] terrains )
🏴☠️
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 Unity.Entities; | |
public class ConvertGameObjectHierarchyExample : MonoBehaviour | |
{ | |
[SerializeField] GameObject _prefab = null; | |
BlobAssetStore _blobAssetStore; | |
void Awake () | |
{ | |
var world = World.DefaultGameObjectInjectionWorld; |
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
// src: https://gist.github.com/andrew-raphael-lukasik/66d898be737734f26e607e6526d22901 | |
using IO = System.IO; | |
using UnityEngine; | |
using Unity.Entities; | |
using Unity.Scenes; | |
using Unity.Entities.Serialization; | |
public static class Worlds | |
{ |
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
// src* https://gist.github.com/andrew-raphael-lukasik/b5cd9eb0c6f36388069d3211554409de | |
using UnityEngine; | |
using Unity.Collections; | |
using Unity.Collections.LowLevel.Unsafe; | |
// Project Settings/Player/Other Settings/Script Compilation/Allow `Unsafe` Code = ☑ | |
public static class Mem | |
{ | |
public static unsafe bool Cpy<SRC, DST>(NativeArray<SRC> src, DST[] dst) |
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.Jobs; | |
using Unity.Mathematics; | |
using BurstCompile = Unity.Burst.BurstCompileAttribute; | |
[BurstCompile] public unsafe struct NoSimd : IJob | |
{ | |
public float a, b; | |
public float* c; | |
void IJob.Execute () { *c = a * b; } |
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
// src: https://gist.github.com/andrew-raphael-lukasik/6813fe2b8688eb3ea4e333f21d3cc02a | |
namespace Unity.Entities.Serialization | |
{ | |
public unsafe struct Reader : BinaryReader | |
{ | |
System.IO.BinaryReader _reader; | |
System.IO.FileStream _stream; | |
public Reader ( string filePath ) | |
{ |
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
//Usage example: | |
//yield return Wait.t2s5;//waits 2.5 seconds | |
using UnityEngine; | |
public class Wait | |
{ | |
public readonly static object frame = null; | |
public readonly static WaitForEndOfFrame endOfFrame = new WaitForEndOfFrame(); | |
public readonly static WaitForFixedUpdate fixedUpdate = new WaitForFixedUpdate(); |
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
// src* https://gist.github.com/andrew-raphael-lukasik/530e90ee27cd7a9be47351e03b2634d1 | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.Jobs; | |
using Unity.Entities; | |
using Unity.Transforms; | |
using Unity.Rendering; | |
using Unity.Collections; | |
using Unity.Mathematics; |
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
// src: https://gist.github.com/andrew-raphael-lukasik/bc05310efcb1bcb2875a376494414f36 | |
using Unity.Collections; | |
using Unity.Collections.LowLevel.Unsafe; | |
public interface INativeMinHeapComparer<I,V> | |
where I : unmanaged | |
where V : unmanaged | |
{ | |
int Compare ( I lhs , I rhs , NativeSlice<V> comparables ); | |
} |
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
// src: https://gist.github.com/andrew-raphael-lukasik/e02f21cc507da9e5eb7569b8793e70f4 | |
using System.Collections.Generic; | |
using System.Linq; | |
using IO = System.IO; | |
using UnityEngine; | |
using UnityEngine.Assertions; | |
using UnityEngine.UIElements; | |
#if UNITY_EDITOR | |
using UnityEditor.UIElements; | |
#endif |