Skip to content

Instantly share code, notes, and snippets.

View mousedoc's full-sized avatar
😇

mousedoc mousedoc

😇
  • Netmarble Monster
  • Seoul, Republic of Korea
View GitHub Profile
@mousedoc
mousedoc / UIBasicSprite.cs
Last active June 11, 2024 02:46
Implement NGUI FillDirection.Diagonal
public abstract class UIBasicSprite : UIWidget
{
...
public enum FillDirection
{
Horizontal,
Vertical,
Radial90,
Radial180,
@mousedoc
mousedoc / MissingRefFinder.cs
Created June 28, 2022 07:32
Unity Missing Reference Finder
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
/// <summary>
/// Utility script for finding missing references to objects.
@mousedoc
mousedoc / LegacyAnimationCreator.cs
Created June 14, 2022 03:14
Unity Legacy Animation Creator
using System.IO;
using UnityEditor;
using UnityEngine;
public class LegacyAnimationCreator
{
[MenuItem("Assets/Create/Legacy Animation", priority = 402)]
public static void CompressSelectedAnimationClips()
{
var clip = new AnimationClip();
@mousedoc
mousedoc / FontExtension.cs
Last active July 16, 2020 06:22
UnityEngine.Font extension
public static class FontExtension
{
// Call it when the type of the string assigned to the global Text component is minimal.
// XXX : If font is in AssetBundle, it may not work correctly.
public static void RefreshDynamicTexture(this Font font)
{
if (font == null || font.dynamic == false)
return;
Resources.UnloadAsset(font);
@mousedoc
mousedoc / MaterialRefCleaner.cs
Last active December 2, 2024 09:28
Unity Material Old Reference Cleaner (Requires Unity 2017.4 or later)
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
public class MaterialRefCleaner : EditorWindow
{
private SerializedObject serializedObject;
private Material selectedMaterial;
[MenuItem("Tools/Optimization/Material/Open Material Reference Cleaner", priority = 51)]
@mousedoc
mousedoc / FieldsToLine.cs
Last active June 28, 2022 07:14
C# - String array to CSV Line
public static string FieldsToLine(string[] fields)
{
if (fields == null || fields.Length <= 0)
return string.Empty;
string line = string.Empty;
foreach (var field in fields)
{
string convertedField = field;
@mousedoc
mousedoc / Fix55To54.cs
Created December 5, 2017 05:09 — forked from johnsoncodehk/Fix55To54.cs
Fix Unity 5.5 Downgrading to 5.4 missing GameObject name, activeSelf.
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Collections.Generic;
public class Fix55To54 {
[System.SerializableAttribute]
public class GameObjectData {
public bool activeSelf;