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
// Source: https://gist.github.com/Z4urce/e1719b3c1641537ced54da24d911f0b0 | |
// Moves the Content transform so the current selected object will be inside the Viewport rect | |
using UnityEngine; | |
using UnityEngine.EventSystems; | |
namespace Utils | |
{ | |
public sealed class ScrollToSelectionBehaviour : MonoBehaviour | |
{ |