Skip to content

Instantly share code, notes, and snippets.

View k-okawa's full-sized avatar

KyoheiOkawa k-okawa

View GitHub Profile
@Refsa
Refsa / GrabScreenFeature.cs
Last active April 9, 2024 13:04
Unity URP custom grab pass
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public class GrabScreenFeature : ScriptableRendererFeature
{
[System.Serializable]
public class Settings
@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)