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
using UnityEngine; | |
using UnityEngine.EventSystems; | |
using UnityEngine.UI; | |
public class NestedScrollRect : ScrollRect | |
{ | |
public override void OnInitializePotentialDrag(PointerEventData eventData) | |
{ | |
for(int i = 0; i < m_parentInitializePotentialDragHandlers.Length; ++i) | |
{ |
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
using System.Collections.Generic; | |
using Unity.Mathematics; | |
using UnityEngine; | |
public class SpatialHashGrid<T> where T : MonoBehaviour | |
{ | |
public SpatialHashGrid(int xSize, int ySize, int zSize) => CellSize = new int3(xSize, ySize, zSize); | |
public SpatialHashGrid(int3 cellSize) => CellSize = cellSize; |
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
using System.Collections; | |
using UnityEngine; | |
using UnityEngine.UI; | |
public static class ScrollViewFocusFunctions | |
{ | |
public static Vector2 CalculateFocusedScrollPosition( this ScrollRect scrollView, Vector2 focusPoint ) | |
{ | |
Vector2 contentSize = scrollView.content.rect.size; | |
Vector2 viewportSize = ( (RectTransform) scrollView.content.parent ).rect.size; |