This file contains 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; | |
public class ScrollRectTransform : MonoBehaviour | |
{ | |
public Vector2 ScrollPosition | |
{ | |
get => _content.anchoredPosition; | |
set => SetScrollPosition(value); | |
} |
This file contains 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
// Taken from http://wiki.unity3d.com/index.php/SceneField | |
using UnityEngine; | |
[System.Serializable] | |
public class SceneField : ISerializationCallbackReceiver | |
{ | |
#if UNITY_EDITOR | |
public UnityEditor.SceneAsset sceneAsset; |
This file contains 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; | |
public class CameraControllerPhoto : CameraControllerBase | |
{ | |
public float Sensitivity = 1.5f; | |
public float MaxPitch = 45.0f; | |
public float MoveSpeed = 10; | |
public float MaxDistance = 30.0f; | |
public float MinDistToGeometry = 2.0f; | |
public float MinDistToTerrain = 5.0f; |
This file contains 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
// The MIT License (MIT) | |
// Copyright (c) 2023 David Evans @festivevector | |
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF O |
This file contains 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 UnityEditor; | |
using UnityEngine; | |
using System.Collections.Generic; | |
public class AssetScratchpad : EditorWindow | |
{ | |
private List<Object> _referenceList = new(); | |
private Vector2 _scrollPosition; | |
[MenuItem("Window/Asset Scratchpad")] |
This file contains 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 System.Collections.Generic; | |
using UnityEngine; | |
#if BUILD_EPIC | |
using PlayEveryWare.EpicOnlineServices; | |
using Epic.OnlineServices; | |
using Epic.OnlineServices.Achievements; | |
using Epic.OnlineServices.Auth; | |
using Epic.OnlineServices.Presence; |
This file contains 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.AI; | |
using System.Collections.Generic; | |
public class PathFindManager : Singleton<PathFindManager> | |
{ | |
public bool IsBuilt => _isBuilt; | |
[SerializeField] | |
private LayerMask _obstacleMask = Physics.DefaultRaycastLayers; |
This file contains 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 System.Collections; | |
public static class Tween | |
{ | |
public static IEnumerator Tween(float duration, System.Action<float> tweenFunc) | |
{ | |
for (float timer = 0; timer < duration; timer += Time.deltaTime) | |
{ | |
tweenFunc?.Invoke(timer / duration); |
This file contains 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; | |
public struct HexCoord | |
{ | |
public float q; | |
public float r; | |
public float s; | |
public HexCoord(float q, float r) | |
{ |
This file contains 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 Unity.Collections; | |
using UnityEngine; | |
using UnityEngine.Rendering; | |
[System.Serializable] | |
public class RenderToCPU | |
{ | |
public event System.Action ErrorOccurred; | |
public int Width => _renderTarget.width; |
NewerOlder