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
Problem: | |
Concept of entities with volume that define different characteristics which need | |
to be volume tested against for various gamelogic purposes. Previous iteration | |
was a grid implementation where these characteristics were represented as | |
bitflags, each `int` a gamelogic concept to be tested against. E.g. Pathing: | |
[None, Impassable, Occupied, Walkable, Flyable, Vaultable, Climbable, | |
Interactable, Teleporter, Staircase] | |
Any volume placed on the grid would OR added to the grid's characteristics | |
bitmasks of the cells it occupied. |
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
// For the new DOTS animation. Although you need to use DrawMeshInstanced yourself, Hybrid renderer does not support instanced | |
// props for builtin. | |
Shader "Custom/VertexSkinning" | |
{ | |
Properties | |
{ | |
_Color ("Color", Color) = (1,1,1,1) | |
_MainTex ("Albedo (RGB)", 2D) = "white" {} | |
_Glossiness ("Smoothness", Range(0,1)) = 0.5 |
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
/////////////////////////////////////////////////////////////////////////////////////// | |
// Native queue collection with fixed length. FILO. | |
// NativeStack<T> supports writing in IJobParallelFor, just use ParallelWriter and AsParallelWriter(). | |
// Not tested to much, works for me with integers and unity 2019.3 | |
// | |
// Assembled with help of: | |
// - NativeCounter example (https://docs.unity3d.com/Packages/[email protected]/manual/custom_job_types.html) | |
// - How to Make Custom Native Collections (https://jacksondunstan.com/articles/4734) | |
// - source code of NativeQueue and NativeList |
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 EntityDiff | |
{ | |
public static ComponentDiffResult<T1> Diff<T1, T2>(this Entity entity, World world = null) | |
where T1: struct, IComponentData, IEquatable<T1> | |
where T2: struct, IDiffComponent<T1> | |
{ | |
if (world == null) | |
{ | |
world = World.Active; | |
} |
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
//------------------------------------------------------------------------------ | |
// <auto-generated> | |
// This code was generated by a tool. | |
// | |
// Changes to this file may cause incorrect behavior and will be lost if | |
// the code is regenerated. | |
// </auto-generated> | |
//------------------------------------------------------------------------------ | |
// Generated by EntityEnumerable.tt (64 `foreach` combinations) |
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.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using Unity.Jobs; | |
using UnityEngine.Jobs; | |
using Unity.Collections; | |
using Unity.Mathematics; | |
public class IJobParallelForFilterTest : MonoBehaviour | |
{ |
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; | |
using Unity.Collections; | |
using Unity.Transforms; | |
using Unity.Rendering; | |
public class ChunkIterationBootstrap : MonoBehaviour | |
{ | |
[SerializeField] RenderMesh meshInstanceRenderer; |
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
// https://forum.unity.com/threads/hybrid-native-container-nativehashmaplist-tkey-tvalue.564118/ | |
//#define DEBUG_HML | |
using Unity.Collections; | |
using System; | |
namespace E7.Native | |
{ | |
/// <summary> |
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 System.Text; | |
using UnityEditor; | |
using UnityEditor.Compilation; | |
using UnityEngine; | |
[InitializeOnLoad] | |
public class AsmdefDebug | |
{ |
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
/******************************************************************************* | |
* Don't Be a Jerk: The Open Source Software License. | |
* Adapted from: https://github.com/evantahler/Dont-be-a-Jerk | |
******************************************************************************* | |
* _I_ am the software author - JohannesMP on Github. | |
* _You_ are the user of this software. You might be a _we_, and that's OK! | |
* | |
* This is free, open source software. I will never charge you to use, | |
* license, or obtain this software. Doing so would make me a jerk. | |
* |
NewerOlder