Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Reflection;
using UnityEngine;
using UnityEngine.Events;
#if UNITY_EDITOR
using UnityEditor.Events;
#endif
[Serializable]
namespace Match3 {
public class GridObject<T> {
GridSystem2D<GridObject<T>> grid;
int x;
int y;
T gem;
public GridObject(GridSystem2D<GridObject<T>> grid, int x, int y) {
this.grid = grid;
this.x = x;
using System;
using UnityEngine;
using TMPro;
/// <summary>
/// A generic 2D grid implementation that can be used in both 2D and 3D.
/// The grid stores values of a specified type and provides methods for accessing and modifying
/// these values based on grid coordinates or world coordinates. The grid can be displayed
/// either vertically (X-Y plane) or horizontally (X-Z plane) using a CoordinateConverter.
/// </summary>
@adammyhre
adammyhre / InspectorLock.cs
Last active July 7, 2025 00:26
Lock Inspector Icon and Transform Constrain Proportion Icon in Unity
using System.Reflection;
using UnityEditor;
using UnityEngine;
/// <summary>
/// Toggles the Inspector lock state and the Constrain Proportions lock state.
/// </summary>
public static class LockInspector {
static readonly MethodInfo flipLocked;
static readonly PropertyInfo constrainProportions;