🏴☠️
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
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/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
// src* https://gist.github.com/andrew-raphael-lukasik/7229d38dbbc0baa3c2a2ab106fb4f7ef | |
using UnityEngine; | |
using UnityEngine.UIElements; | |
[UnityEngine.Scripting.Preserve] | |
public class LineSegmentDrawer : VisualElement | |
{ | |
public float startX { get; set; } | |
public float startY { get; set; } | |
public float endX { 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.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; } |