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
String fileName = "test"; | |
List<String> fileNames = new ArrayList<String>(); | |
for (fileName : fileNames) { | |
// error? | |
} |
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.EventSystems; | |
using UnityEngine.UI; | |
namespace Bombardel | |
{ | |
public class BetterToggle : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler, IPointerDownHandler, IPointerUpHandler | |
{ |
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; | |
using UnityEngine; | |
//by Pepijn Willekens | |
// https://github.com/peperbol | |
// https://twitter.com/PepijnWillekens | |
public static class VectorExtension | |
{ | |
public static Vector3 ChangeX(this Vector3 parent, float newX) |
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 static class TransformExtension | |
{ | |
public static T[] GetAllComponentsInChildren<T>(this Transform transform) | |
{ | |
return transform.GetComponentsInChildren<T>(true); | |
} | |
public static T[] GetAllComponentsInParent<T>(this Transform transform) |
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.IO; | |
using System; | |
public static class RenderTextureExtensions | |
{ | |
private static DefaultDictionary<RenderTexture, Texture2D> _cachedTextures = new DefaultDictionary<RenderTexture, Texture2D>(); | |
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
public static class ListExtensions | |
{ | |
public static T MaxBy<T, U>(this IEnumerable<T> data, Func<T, U> f) where U : IComparable | |
{ | |
if (data.Count() == 0) throw new ArgumentException($"Cannot get the max of an empty list."); |