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
type Vector = number[] | |
function add(u: Vector, v: Vector): Vector { | |
return u.map((x, i) => x + v[i]) | |
} | |
function sub(u: Vector, v: Vector): Vector { | |
return u.map((x, i) => x - v[i]) | |
} |
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 UnityEngine; | |
#if UNITY_EDITOR | |
using UnityEditor; | |
#endif | |
public class MaxLengthAttribute : PropertyAttribute { | |
public readonly uint Length; | |
public MaxLengthAttribute(uint 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
#nullable enable | |
#region Usings | |
using Unity.Burst; | |
using Unity.Collections; | |
using Unity.Entities; | |
using Unity.Jobs; | |
using Unity.Mathematics; | |
using Unity.Transforms; | |
using UnityEngine.InputSystem; | |
#endregion |
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
// gist by Roystan (IronWarrior): https://gist.github.com/IronWarrior/005f649e443bf51b656729231d0b8af4 | |
// Video demo: https://twitter.com/DavigoGame/status/1300842800964018178 | |
// | |
// CONTRIBUTIONS: | |
// Mac and Linux support added by Creature Coding: https://creaturecoding.com/ | |
// | |
// PURPOSE: | |
// Unity does not permit a project to be open in two different editor instances. | |
// This can be frustrating when building projects with multiplayer networking, | |
// as it would require you to create a build every time you wish you test your netcode. |
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
[MethodImpl(MethodImplOptions.AggressiveInlining)] | |
public static T GetComponentData<T>(this Entity entity, World world = null) where T: struct, IComponentData | |
{ | |
if (world == null) | |
{ | |
world = World.Active; | |
} | |
return world.EntityManager.GetComponentData<T>(entity); | |
} |
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
export default [ | |
"Reticulating splines...", | |
"Generating witty dialog...", | |
"Swapping time and space...", | |
"Spinning violently around the y-axis...", | |
"Tokenizing real life...", | |
"Bending the spoon...", | |
"Filtering morale...", | |
"Don't think of purple hippos...", | |
"We need a new fuse...", |
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 UnityEngine; | |
using System.Linq; | |
[RequireComponent(typeof(Rigidbody))] | |
public class RigidbodyMassCalculator : MonoBehaviour { | |
public float density = 1f; | |
public bool recalculateOnAwake = true; | |
Rigidbody rb; |