// NOTE: this class assumes that you designate StringTable keys in label fields (as seen in Label, Button, etc) // and start them all with '#' char (so other labels will be left be)
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.Diagnostics; | |
using System.Diagnostics.CodeAnalysis; | |
using System.Runtime.CompilerServices; | |
namespace Storage.Benchmark.Glo; | |
[DebuggerDisplay("Length = {Length}")] | |
[SuppressMessage("ReSharper", "InvertIf")] | |
internal struct Glossary<TValue> | |
where TValue : struct |
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
public void PrintByteArray(byte[] bytes) | |
{ | |
var sb = new StringBuilder("new byte[] { "); | |
foreach (var b in bytes) | |
{ | |
sb.Append(b + ", "); | |
} | |
sb.Append("}"); | |
Console.WriteLine(sb.ToString()); | |
} |
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.Generic; | |
using System.Linq; | |
using UnityEngine; | |
using UnityEditor; | |
public static class FindMissingScriptsRecursively | |
{ | |
[MenuItem("Auto/Remove Missing Scripts Recursively Visit Prefabs")] | |
private static void FindAndRemoveMissingInSelected() | |
{ | |
// EditorUtility.CollectDeepHierarchy does not include inactive children |
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.UI; | |
/// A concrete subclass of the Unity UI `Graphic` class that just skips drawing. | |
/// Useful for providing a raycast target without actually drawing anything. | |
public class NonDrawingGraphic : Graphic | |
{ | |
public override void SetMaterialDirty() { return; } | |
public override void SetVerticesDirty() { return; } |
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
import com.badlogic.gdx.Gdx; | |
import com.badlogic.gdx.graphics.OrthographicCamera; | |
import com.badlogic.gdx.graphics.g2d.BitmapFont; | |
import com.badlogic.gdx.graphics.g2d.SpriteBatch; | |
import com.badlogic.gdx.utils.Disposable; | |
import com.badlogic.gdx.utils.TimeUtils; | |
/** | |
* A nicer class for showing framerate that doesn't spam the console | |
* like Logger.log() |