- gifcam records frames uncompressed, and it's a 32bit software, so you can easily run out of memory if you record a large piece of the screen for a long time. If that happens, it usually hangs and becomes unresponsive, and you need to stop the process, but sometimes it pings a warning, or just silently crashes.
- To check how big your gif is, without saving the file, expand the menu beside Save > and click on Preview, after it's done compressing it will preview and show the size in the window title. This is important to know because there are gif upload limits everywhere, on Twitter it's 15MB, and on Discord it's 8MB (as of August 2020);
- To reduce the size of the gif to fit in ^ those sizes, I usually try not to change a compression method (to something else than quantize, because it's almost always superior), but instead crop, trim or resize gifs.
- Gifs ALWAYS have a one pixel wide black border (not sure why!?). You can actually remove it by just cropping the outside a bit in Edit > right click > Crop.
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
| // This is a C# example from Red Blob Games (https://www.redblobgames.com/pathfinding/a-star/implementation.html#csharp). Remade to have no GCAllocs | |
| // Changes: | |
| // - Made to work in Unity and draw gizmos on screen instead of console text; | |
| // - Cache all collections in Init(), then when Search() is called, no allocs are being made; | |
| // - Uses Unity's Vector2Int that avoids boxing when comparing structs; | |
| // - graph.Neighbors() no longer uses an IEnumerable<>. instead, fill a list with neighbors; | |
| using System; | |
| using System.Collections.Generic; | |
| using UnityEngine; |
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
| // A very basic and silly example of some class that contains a slow operation we'd like to compile with Burst. | |
| // This only shows how to CONVERT a -theoretically- already existing piece of code, and still reap the benefits of the Burst compiler. | |
| // If you started with knowing it will be Burst compiled from the beginning you might design everything differently. | |
| // This is an example of how we might do a thing in classic C# OOP | |
| public class ClassicExample | |
| { | |
| public int multiplier = 2; | |
| const int CONST = 42; | |
| public int[] array; |
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
| template <typename T> | |
| class SwappingPool | |
| { | |
| public: | |
| const size_t size; | |
| private: | |
| size_t headi{ 0 }; | |
| T* data; | |
| public: |
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; | |
| class Program | |
| { | |
| static List<int> pare; | |
| static void Main(string[] args) | |
| { | |
| pare = new List<int>(); |
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
| public static void SafeDestroy<T>(T obj) where T : Object | |
| { | |
| if (Application.isPlaying) | |
| Object.Destroy(obj); | |
| else | |
| Object.DestroyImmediate(obj); | |
| } | |
| // Call in OnValidate, OnTriggerEnter, etc, with StartCoroutine() out of play mode | |
| public static IEnumerator Catch22Destroy<T>(T obj) where T : Object |
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
| { | |
| "files.exclude": { | |
| "**/.svn": true, | |
| "**/.hg": true, | |
| "**/CVS": true, | |
| "**/.DS_Store": true, | |
| "**/*.meta": true | |
| }, | |
| "editor.renderWhitespace": "none", | |
| "csharp.suppressDotnetInstallWarning": true, |
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
| // Rebinding using InputSystem from Prokuv'o | |
| using System; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| using UnityEngine.InputSystem; | |
| public class Rebinder : 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
| /// A little Minesweeper for Unity using GUI | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| public class Minesweeper : MonoBehaviour | |
| { | |
| public enum TileState | |
| { |
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
| #include "pch.h" | |
| #include <iostream> | |
| #include <vector> | |
| #include <array> | |
| #include <map> | |
| #define LOG(x) std::cout << x << std::endl | |
| struct Node | |
| { |