Skip to content

Instantly share code, notes, and snippets.

@mattatz
mattatz / SlackWebhook.cs
Created November 28, 2019 08:38
Post a message to a slack channel in Unity by webhook.
using System.Collections;
using UnityEngine;
using UnityEngine.Networking;
[System.Serializable]
public class SlackAttachment
{
public string title;
public string text;
using System;
using System.IO;
using System.Linq;
using System.Net;
using System.Text.RegularExpressions;
using UnityEditor;
using UnityEngine;
/// <summary>
/// Gist importer.
@Happsson
Happsson / InactiveCodeDetector.cs
Last active September 14, 2023 15:35
A script that lets you find unused scripts in your unity projects.
/*
This tool iterates through all the files in your project and checks for scripts.
It then goes through all the GameObjects in all the scenes in the project, and
checks for scripts that are not present on any GameObjects.
Note that this does not mean that the script is not used, just that it is possible that it isn't.
The script could still be used in many other ways. This tool is just to narrow the search for
unused code.
@MerlinTwi
MerlinTwi / AppInfo.cs
Last active March 29, 2024 20:02
Auto update Unity bundleVersion and save build time
using System;
public static class AppInfo {
//--- AutoGenerated.begin
public const string Version = "1.0.3";
public static readonly DateTime Date = new DateTime(2018, 04, 29, 13, 41, 08, 331, DateTimeKind.Utc);
//--- AutoGenerated.end
}
@yasirkula
yasirkula / EditorCollapseAll.cs
Last active October 24, 2024 06:17
An editor script for Unity 3D to collapse all GameObject's in Hierarchy view or to collapse all folders in Project view. See the comments section below for instructions.
using System.Collections.Generic;
using System.Reflection;
using UnityEditor;
using UnityEditor.IMGUI.Controls;
using UnityEditorInternal;
using UnityEngine.SceneManagement;
public static class EditorCollapseAll
{
private const BindingFlags INSTANCE_FLAGS = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance;
using System;
using UnityEngine;
public static class ApplicationState
{
/// <summary>
/// Is editor either currently in play mode, or about to switch to it?
/// </summary>
public static bool isPlayingOrWillChangePlaymode { get { return Application.isEditor ? InternalEditorState.isPlayingOrWillChangePlaymode : true; } }
/// <summary>
@Seneral
Seneral / EditorLoadingControl.cs
Last active November 21, 2018 20:29
Extended editor callbacks for entering/leaving playmode and new scenes in Unity
#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;
#if UNITY_5_3_OR_NEWER || UNITY_5_3
using UnityEngine.SceneManagement;
using UnityEditor.SceneManagement;
#endif
using System;
@Marneus68
Marneus68 / gist:015429675e7e616e6828
Created February 11, 2016 16:01
mergespecfile.txt
#
# UnityYAMLMerge fallback file
#
# Modify the next two lines if scene or prefab files should fallback
# on other that the default fallbacks listed below.
#
# %l is replaced with the path of you local version
# %r is replaced with the path of the incoming remote version
# %b is replaced with the common base version
@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:
@robertwahler
robertwahler / Shortcuts.cs
Last active August 10, 2018 23:06
Unity Shortcuts via Reflection
using UnityEditor;
using UnityEngine;
using UnityTest;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace SDD.Editor {
/// <summary>