Original One page GDD in Notion by Marnix
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 UnityEngine; | |
| public abstract class UnitySerializedDictionaty<TKey, TValue> : Dictionary<TKey, TValue>, ISerializationCallbackReceiver | |
| { | |
| [SerializeField] private List<KeyValueData> keyValueData = new List<KeyValueData>(); | |
| public void OnBeforeSerialize() | |
| { | |
| keyValueData.Clear(); |
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.UI; | |
| using UnityEngine.EventSystems; | |
| public class UIContentCarousel : MonoBehaviour, IEndDragHandler, IBeginDragHandler | |
| { | |
| [Header("Important Information")] | |
| [Tooltip("Ensure that a GridLayoutGroup is assigned to CONTENT. The correct layout group is crucial for the proper functioning of the carousel.")] | |
| [TextArea(3, 5)] | |
| public string layoutGroupWarning; |
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 UnityEditor; | |
| using UnityEngine; | |
| public class GetSelectedObject : MonoBehaviour | |
| { | |
| public static GameObject a; | |
| [MenuItem("Tools/Select Object &a")] | |
| static void SelectObject() | |
| { |
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.Linq; | |
| using System.Reflection; | |
| using UnityEditor; | |
| using UnityEngine; | |
| using System.Collections; | |
| using Object = UnityEngine.Object; | |
| public class InspectorLockToggle | |
| { |
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; | |
| /// <summary> | |
| /// Be aware this will not prevent a non singleton constructor | |
| /// such as `T myT = new T();` | |
| /// To prevent that, add `protected T () {}` to your singleton class. | |
| /// | |
| /// As a note, this is made as MonoBehaviour because we need Coroutines. | |
| /// </summary> | |
| public class Singleton<T> : MonoBehaviour where T : MonoBehaviour |
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; | |
| public class ScreenSize | |
| { | |
| public static float GetScreenToWorldHeight | |
| { | |
| get | |
| { | |
| Vector2 topRightCorner = new Vector2(1, 1); | |
| Vector2 edgeVector = Camera.main.ViewportToWorldPoint(topRightCorner); | |
| var height = edgeVector.y * 2; |
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 TMPro; | |
| using UnityEngine; | |
| public class FPSScript : MonoBehaviour | |
| { | |
| /// <summary> | |
| /// Delta time | |
| /// </summary> | |
| float deltaTime = 0.0f; |
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; | |
| public class RectTransformTools { | |
| [MenuItem("GameObject/Adjust RectTransform Anchors &a")] | |
| static void Adjust() | |
| { | |
| foreach(GameObject gameObject in Selection.gameObjects){ | |
| adjustRectTransform(gameObject); |