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 System; | |
| using UnityEngine.Profiling; | |
| // See UnityEngine.TestTools.Constraints.AllocatingGCMemoryConstraint | |
| // and https://maingauche.games/devlog/20230504-counting-allocations-in-unity/ | |
| public class AllocCounter { | |
| UnityEngine.Profiling.Recorder rec; | |
| public AllocCounter() { | |
| rec = Recorder.Get("GC.Alloc"); |
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 System.Collections; | |
| using UnityEngine; | |
| using UnityEngine.Pool; | |
| using UnityEngine.Rendering.Universal; | |
| public class BulletHoleSpawner : MonoBehaviour { | |
| #region Fields | |
| IObjectPool<DecalProjector> decalPool; | |
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 System; | |
| using System.Linq; | |
| using Unity.Cinemachine; | |
| using UnityEngine; | |
| using UnityEngine.InputSystem; | |
| using UnityUtils; | |
| [Serializable] | |
| public class AOETargeting : TargetingStrategy { | |
| public GameObject aoePrefab; |
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 System; | |
| using System.Collections.Generic; | |
| using ImprovedTimers; // https://github.com/adammyhre/Unity-Improved-Timers | |
| using UnityEngine; | |
| [Serializable] | |
| public class Ability { | |
| public AudioClip castSfx; | |
| public GameObject castVfx; | |
| public GameObject runningVfx; |
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.Collections.Generic; | |
| using UnityUtils; // https://github.com/adammyhre/Unity-Utils | |
| public class CullingManager : Singleton<CullingManager> { | |
| #region Fields | |
| public Camera cullingCamera; | |
| public float maxCullingDistance = 100f; | |
| public LayerMask cullableLayers; |
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; | |
| using System.Collections.Generic; | |
| using System.Runtime.CompilerServices; | |
| using CanTarget = And<And<InRange, IsAlive>, LineOfSight>; | |
| // ---------- Domain ---------- | |
| class Health : MonoBehaviour { | |
| public int hp = 10; |
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 System; | |
| using System.Collections.Generic; | |
| using TMPro; | |
| using Unity.Cinemachine; | |
| using UnityEngine; | |
| using UnityEngine.UI; | |
| using UnityUtils; | |
| [DisallowMultipleComponent] | |
| public class EnemyWorldUI : MonoBehaviour { |
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
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| ############################################## | |
| # make-template.sh | |
| # | |
| # This script packages a Unity template for local use | |
| # in Unity Hub's ProjectTemplates folder. | |
| # | |
| # How it works: |
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 System; | |
| using Unity.Collections; | |
| using Unity.Collections.LowLevel.Unsafe; | |
| public unsafe class ArenaAllocator : IDisposable { | |
| byte* buffer; // 'buffer' is a pointer to a byte (i.e., byte*) | |
| int offset; | |
| readonly int capacity; | |
| public ArenaAllocator(int sizeInBytes) { |
NewerOlder