Skip to content

Instantly share code, notes, and snippets.

View edwardrowe's full-sized avatar

Edward Rowe edwardrowe

View GitHub Profile
@edwardrowe
edwardrowe / Git.cs
Last active December 7, 2023 03:13
Exposes Git commands to C#, intended for use in Unity as part of a Build Automation tool
/* MIT License
Copyright (c) 2016 RedBlueGames
Code written by Doug Cox
*/
using System;
using UnityEngine;
/// <summary>
/// GitException includes the error output from a Git.Run() command as well as the
@edwardrowe
edwardrowe / Comment.cs
Last active July 17, 2023 00:11
Unity - Draw Icon on GameObject in Hierarchy
/*The MIT License (MIT)
Copyright (c) 2016 Edward Rowe (@edwardlrowe)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
@edwardrowe
edwardrowe / CommentComponent.cs
Created April 28, 2021 18:26
Unity CommentComponent
using System.Collections;
using UnityEngine;
/// <summary>
/// Simple component that allows users to write comments to place on MonoBehaviours. Mainly for testmaps.
/// </summary>
public class CommentComponent : MonoBehaviour
{
[TextArea(3, 10)]
[SerializeField]
@edwardrowe
edwardrowe / RenameSpritesheet.cs
Last active March 22, 2023 01:22
Unity - RenameSpritesheet
/*The MIT License (MIT)
Copyright (c) 2016 Edward Rowe (@edwardlrowe)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@edwardrowe
edwardrowe / AnimClipBuilder.cs
Last active February 3, 2023 06:42
Unity - Build Clip From Selected Texture
/*The MIT License (MIT)
Copyright (c) 2016 Edward Rowe (@edwardlrowe)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@edwardrowe
edwardrowe / EmbeddedInspectorAttribute.cs
Created August 30, 2016 21:11
EmbeddedInspectorAttribute
/*The MIT License (MIT)
Copyright (c) 2016 Edward Rowe (@edwardlrowe)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@edwardrowe
edwardrowe / MyEditorToolPreferences.cs
Created October 16, 2018 15:26
UnityTip-Serializing Preferences (10/16/18)
[System.Serializable]
private struct MyEditorToolPreferences
{
// Private fields with the SerializeField attribute will be saved
[SerializeField]
private int savedInt;
// Public fields are also serializable (though I prefer private with the attribute)
public bool SavedBool;
@edwardrowe
edwardrowe / BuildToolExample.cs
Last active March 22, 2021 16:12
An example of a Build Tool, used to accompany my blog post on Versioning with git in Unity.
/* MIT License
Copyright (c) 2016 RedBlueGames
*/
using UnityEditor;
using UnityEngine;
using UnityEditor.Build.Reporting;
public class BuildToolExample : MonoBehaviour
{
@edwardrowe
edwardrowe / SelectionHistoryWindow.cs
Created May 12, 2020 13:08
Selection History management window for Unity
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
/// <summary>
/// Selection history window watches the selection and adds Forward and Back buttons to navigate previous selections.
/// </summary>
public class SelectionHistoryWindow : EditorWindow, IHasCustomMenu
{
@edwardrowe
edwardrowe / ProcessExtensions.cs
Created March 20, 2020 02:17
Extensions to System.Diagnostics's Process class in C#
using System.Diagnostics;
using System.Text;
public static class ProcessExtensions
{
/* Properties ============================================================================================================= */
/* Methods ================================================================================================================ */
/// <summary>