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
# Unity specific .gitattributes | |
* text=auto | |
*.cs diff=csharp text | |
*.cginc text | |
*.shader text | |
# Unity YAML | |
*.anim -text merge=unityyamlmerge diff |
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; | |
using System.Collections.Generic; | |
public struct Either<TLeft, TRight> { | |
readonly TLeft left; | |
readonly TRight right; | |
readonly bool isRight; | |
Either(TLeft left, TRight right, bool isRight) { | |
this.left = left; |
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 TMPro; | |
using UnityEngine; | |
using System.Linq; | |
public class InputFieldFormatter : MonoBehaviour | |
{ | |
[SerializeField] private string startValue = "10.02.2024"; | |
[SerializeField] private string pattern = "&&.&&.&&&&"; | |
[SerializeField] private char splitChar = '.'; |
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; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.Purchasing; | |
using UnityEngine.Purchasing.Security; | |
public class IAPManager : IStoreListener | |
{ | |
public enum State { PendingInitialize, Initializing, SuccessfullyInitialized, FailedToInitialize }; |
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
// ---------------------------------------------------------------------------- | |
// The MIT License | |
// EmojiHelper https://gist.github.com/mopsicus/3903a1f111a738375a363b9e3f058385 | |
// Copyright (c) 2022 Mopsicus <[email protected]> | |
// ---------------------------------------------------------------------------- | |
using System; | |
using System.Collections.Generic; | |
using System.Globalization; | |
using System.IO; |
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.EventSystems; | |
public class SwipeDetector : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler | |
{ | |
private Vector2 lastPosition; | |
public Vector2 swipeDelta; | |
private Coroutine coroutine; |
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; | |
using UnityEngine; | |
using UnityEngine.LowLevel; | |
using UnityEngine.PlayerLoop; | |
public static class PlayerLoopCleaner | |
{ | |
private static readonly Type[] typesToRemove = new Type[] { | |
typeof(EarlyUpdate.Physics2DEarlyUpdate), | |
// Physics 2D |
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
#!/bin/bash | |
for i in *psd | |
do | |
name=${i%.psd} | |
convert "$name.psd[0]" -resize 100% "$name.png" | |
done |
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 UnityEditor; | |
using UnityEditor.SceneManagement; | |
// Adds a "Edit Prefab" option in the Assets menu (or right clicking an asset in the project browser). | |
// This opens an empty scene with your prefab where you can edit it. | |
// Put this script in your project as Assets/Editor/EditPrefab.cs | |
public class EditPrefab { | |
static Object getPrefab(Object selection) { |
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 UnityEditor; | |
using System.IO; | |
public static class CustomInspectorCreator | |
{ | |
[MenuItem("Assets/Create/Custom Inspector", priority = 81)] | |
static void CreateInsptorEditorClass() | |
{ | |
foreach (var script in Selection.objects) |
NewerOlder