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.Reflection; | |
using UnityEditor; | |
using UnityEngine; | |
public static class PackageManagerHelper { | |
const string ServicesNamespace = "UnityEditor.PackageManager.UI.Internal"; | |
/// <summary> | |
/// Resolves a PackageManager service by its interface name. |
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; | |
public struct Closure<TContext> { | |
Delegate del; | |
TContext context; | |
public Closure(Delegate del, TContext context = default) { | |
this.del = del; | |
this.context = context; | |
} |
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; | |
public struct Either<TLeft, TRight> { | |
readonly TLeft left; | |
readonly TRight right; | |
readonly bool isRight; | |
Either(TLeft left, TRight right, bool isRight) { | |
this.left = left; |
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 UnityEngine; | |
/// <summary> | |
/// Represents a signal that allows subscribers to register callbacks that are invoked when the signal is dispatched. | |
/// </summary> | |
public class Signal<T> { | |
readonly LinkedList<Listener> listeners = new (); | |
readonly object lockObject = new (); |
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.Linq.Expressions; | |
using UnityEngine; | |
public class DamageCalculator : MonoBehaviour { | |
void Start() { | |
Func<int, int, int> damageExpression = CreateDamageEvaluator(); | |
int damage = damageExpression(10, 2); | |
Debug.Log($"Calculated Damage: {damage}"); |
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 UnityEditor; | |
using UnityEngine; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
[InitializeOnLoad] | |
public static class HierarchyIconDrawer { | |
static readonly Texture2D requiredIcon = AssetDatabase.LoadAssetAtPath<Texture2D>("Assets/_Project/Art/RequiredIcon.png"); |
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.Generic; | |
namespace Automata { | |
public abstract class State { | |
protected readonly PushDownAutomata pda; | |
protected State(PushDownAutomata pda) { | |
this.pda = pda; | |
} | |
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 Unity.Burst; | |
using Unity.Collections; | |
using Unity.Jobs; | |
using Unity.Mathematics; | |
using UnityEngine; | |
using UnityEngine.UI; | |
using TMPro; | |
public class OptimalSpatialHashing : 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 System; | |
using Unity.Cinemachine; | |
using UnityEngine; | |
using UnityEngine.Splines; | |
[Serializable] | |
public class SmoothFollow : SplineAutoDolly.ISplineAutoDolly { | |
[Tooltip("Maximum speed of the dolly along the spline.")] | |
public float MaxSpeed = 0.5f; |
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 Cysharp.Threading.Tasks; | |
/// <summary> | |
/// Provides helper methods for working with UniTask, including methods to await multiple tasks | |
/// and capture their results or exceptions. | |
/// </summary> | |
public class UniTaskHelpers { | |
/// <summary> | |
/// Awaits two UniTasks and returns a tuple containing the results or exceptions for each task. |
NewerOlder