Skip to content

Instantly share code, notes, and snippets.

View sooraj888's full-sized avatar
🎯
Focusing

sooraj888

🎯
Focusing
View GitHub Profile
@bernatgy
bernatgy / TerrainAuthoring.cs
Last active March 5, 2026 13:09
Solution to terrain baking in Unity DOTS. Could be improved with chunks, baking systems, etc... All credits to the lovely folks over at https://forum.unity.com/threads/using-unity-terrain-with-dots-workflow.755105/ I just cut it together, made some small adjustments and made sure it still works with *Entities 1.2.0-pre.6*
using System;
using Unity.Collections;
using Unity.Entities;
using Unity.Mathematics;
using Unity.Physics;
using UnityEngine;
using UnityEngine.Serialization;
namespace Custom.Authoring
{
@NishiGaba
NishiGaba / iterate-over-array.js
Last active November 29, 2023 10:27
8 Methods to Iterate through Array
//8 Methods to Iterate through Array
//forEach (Do Operation for Each Item in the Array)
[1,2,3].forEach(function(item,index) {
console.log('item:',item,'index:',index);
});
//map (Translate/Map all Elements in an Array to Another Set of Values.)
const oneArray = [1,2,3];
const doubledArray = oneArray.map(function(item) {