Skip to content

Instantly share code, notes, and snippets.

View Besjan's full-sized avatar

Cuku Besjan

  • Berlin
View GitHub Profile
@tattyd
tattyd / Shadow.cs
Last active June 5, 2024 21:52
Soft shadow control for Unity UI Toolkit
/* MIT License
Copyright (c) 2022 David Tattersall
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@instance-id
instance-id / CreateAddressableWithShortName.cs
Last active January 23, 2024 15:32
An example of creating an Addressable GameObject from a prefab with a simplified name
// ------------------------------------------------------------------------------------ AddressInfo
// --- AddressInfo --------------------------------------------------------------------------------
public static class AddressInfo
{
public static string prefabGroup = "Prefabs";
public static string prefabLabel = "Prefab";
}
// ------------------------------------------------------------------------------ AddressableHelper
// --- AddressableHelper --------------------------------------------------------------------------
@dakom
dakom / ECS notes.md
Last active May 27, 2024 10:42
ECS with sparse array notes (EnTT style)

Intro

The below is a breakdown / bird's eye view of how a sparse-array backed ECS like EnTT or Shipyard works.

Please see the thanks and references at the bottom - without their help I would not have been able to share this breakdown with you... everything here is really just notes and rephrasing of what they've written already :)

Also, these notes do not cover archetype systems (like unity) nor adaptations of archetypes (like in Flecs). Though there's a couple comparative footnotes at the end.

Here we go!

@mob-sakai
mob-sakai / RemoveEmptyFolders.cs
Last active September 22, 2023 18:33
Automatically remove empty folders in project for Unity.
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Linq;
using System;
/// <summary>
/// Remove empty folders automatically.
@mzaks
mzaks / Entitas-BT.cs
Last active September 5, 2022 11:55
Sketch for Entitas-CSharp Behaviour Tree implementation
// Based on http://www.gamasutra.com/blogs/ChrisSimpson/20140717/221339/Behavior_trees_for_AI_How_they_work.php
public enum NodeStatus
{
Success, Failure, Running
}
public interface IBehaviorNode
{
NodeStatus Execute(Entity entity);