Skip to content

Instantly share code, notes, and snippets.

@adammyhre
adammyhre / DamageNumberSpawner.cs
Last active July 28, 2025 20:56
World Space UI Toolkit
using PrimeTween;
using UnityEngine;
using UnityEngine.Pool;
using UnityUtils;
public class DamageNumberSpawner : MonoBehaviour {
[SerializeField] WorldSpaceUIDocument uiDocumentPrefab;
[SerializeField] float positionRandomness = 0.2f;
IObjectPool<WorldSpaceUIDocument> uiDocumentPool;
@adammyhre
adammyhre / GridManager.cs
Created February 9, 2025 12:23
Tactical Pathfinding for A*
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
using TMPro;
public struct Node {
public Vector3 position;
public bool isWalkable;
public Node(Vector3 position, bool isWalkable = false) {
@Matthew-J-Spencer
Matthew-J-Spencer / PlayerAnimator.cs
Created July 6, 2022 11:30
Control unity animations using code. Video: https://youtu.be/ZwLekxsSY3Y
using System;
using UnityEngine;
using UnityEngine.Tilemaps;
using Random = UnityEngine.Random;
public class PlayerAnimator : MonoBehaviour {
[SerializeField] private float _minImpactForce = 20;
// Anim times can be gathered from the state itself, but
// for the simplicity of the video...