Skip to content

Instantly share code, notes, and snippets.

@achimmihca
achimmihca / AnchorsToCornersMenuItems.cs
Last active May 25, 2024 18:25
Unity3D Editor script that adds MenuItem to move the anchors of a RectTransform to its corners.
using UnityEditor;
using UnityEngine;
public static class AnchorsToCornersMenuItems
{
// Hotkey: Alt+A
[MenuItem("Tools/Anchors to Corners (RectTransform)/Width and Height &a")]
public static void MoveAnchorsToCorners()
{
EditorUtils.GetSelectedComponents<RectTransform>().ForEach(it =>