Skip to content

Instantly share code, notes, and snippets.

View keidaroo's full-sized avatar
🏠
Working from home

Kei Asano keidaroo

🏠
Working from home
View GitHub Profile
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
/*RULE
|0 -> nothing | 1 -> wall | 2 -> goal | 3 -> answer|
|0 -> 下 | 1 -> 右 | 2 -> 上 | 3 -> 左|
map
@nkjzm
nkjzm / RectTransformExtensions.cs
Last active April 7, 2022 12:17
座標を変えずにPivotとAnchorの値を変えるRectTransformの拡張メソッド
using UnityEngine;
public static class RectTransformExtensions
{
/// <summary>
/// 座標を保ったままPivotを変更する
/// </summary>
/// <param name="rectTransform">自身の参照</param>
/// <param name="targetPivot">変更先のPivot座標</param>
public static void SetPivotWithKeepingPosition(this RectTransform rectTransform, Vector2 targetPivot)