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
// Developed by Tom Kail at Inkle | |
// Released under the MIT Licence as held at https://opensource.org/licenses/MIT | |
// Must be placed within a folder named "Editor" | |
using System; | |
using System.Reflection; | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEditor; |
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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
/// In Unity pre 2020, each different type you want to make a list from needs its own subclass, like UnityEvents. | |
/// eg : | |
/// [Serializable] public class IntReorderableList : ReorderableList<int> {} | |
[Serializable] |
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
public class DynamicBufferTestSystem : SystemBase | |
{ | |
private EntityQuery _query; | |
private Entity _entity; | |
protected override void OnCreate() | |
{ | |
_query = GetEntityQuery(ComponentType.ReadWrite<MyBufferData>()); | |
_entity = EntityManager.CreateEntity(ComponentType.ReadWrite<MyBufferData>()); | |
EntityManager.GetBuffer<MyBufferData>(_entity).Add(default); |
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
// MIT LICENSE Copyright (c) 2020 Jeffrey Vella | |
// https://gist.github.com/jeffvella/dee1a82bd5edfcdc9d3067d8c038f95c/edit | |
using Unity.Burst; | |
using Unity.Collections; | |
using Unity.Collections.LowLevel.Unsafe; | |
using Unity.Entities; | |
using Unity.Jobs.LowLevel.Unsafe; | |
using UnityEngine; |
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.Mathematics; | |
namespace Unity.Collections | |
{ | |
public static class SpatialIndexingUtility |
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
public struct MovementData | |
{ | |
public float SomethingRelevent; | |
} | |
[StructLayout(LayoutKind.Explicit)] | |
public unsafe struct Movement : IComponentData,IMovementBehavior | |
{ | |
public enum MovementType : int | |
{ |
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
internal struct GridUtility | |
{ | |
[MethodImpl(MethodImplOptions.AggressiveInlining)] | |
public static unsafe void SetFlags(int* flagsPtr, int length, ref NodeFlags addFlags) | |
{ | |
var flagToSet = (int4)(int)addFlags; | |
var batchFlags = (int4*)flagsPtr; | |
// array length must be 4x aligned for overrun on last batch | |
var batchLen = length / 4 + math.select(1, 0, length % 4 != 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
using System; | |
using System.Collections.Generic; | |
using Unity.Collections.LowLevel.Unsafe; | |
using UnityEngine; | |
using UnityEngine.AddressableAssets; | |
using UnityEngine.ResourceManagement.AsyncOperations; | |
using UnityEngine.ResourceManagement.ResourceLocations; | |
using Object = UnityEngine.Object; | |
public class AddressableLabels |
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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.AddressableAssets; | |
using UnityEngine.ResourceManagement.AsyncOperations; | |
using UnityEngine.ResourceManagement.ResourceLocations; | |
using UnityEngine.ResourceManagement.ResourceProviders; | |
using Object = UnityEngine.Object; |
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
public static class SelectionHandler<T> where T : IHandleSelectable, IEquatable<T> | |
{ | |
private static int _selectionHandleHash = nameof(SelectionHandler<T>).GetHashCode(); | |
public static bool IsSelecting { get; private set; } | |
public static Vector2 StartPosition { get; private set; } | |
public static Vector2 CurrentPosition{ get; private set; } | |
public static HashSet<T> Selections { get; } = new HashSet<T>(); | |
public delegate void SelectionEvent(); |
NewerOlder