Skip to content

Instantly share code, notes, and snippets.

@Grizzlage
Grizzlage / GLabelWrap.cs
Last active December 19, 2015 09:59
A quick subclass of FLabel that allows you to set a max line width for text. The string will then be split by word and rejoined with newline characters added to fit that line width.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
// A quick subclass of FLabel that allows you to set a max line width for text.
// The string will then be split by word and rejoined with newline characters added to fit that line width.
// Usage...
// GLabelWrap label = new GLabelWrap("Helvetica", "The quick brown fox jumps over the lazy dog.", 256f);
// Futile.stage.AddChild(label);
@Grizzlage
Grizzlage / jsonToText.command
Created June 25, 2013 17:52
A bash script that'll parse through and rename any json file to txt inside your Unity Assets/Resources folder. Just place this .command file at the root of your project and double click it in finder to run.
#!/bin/bash
BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ASSET_DIR="$BASE_DIR/Assets/Resources/"
find $ASSET_DIR -depth -name "*.json" -exec sh -c 'mv "$1" "${1%.json}.txt"' _ {} \;
echo "Finished. All JSON files have been renamed."