Skip to content

Instantly share code, notes, and snippets.

View giacomelli's full-sized avatar
🎮
gamedev

Diego Giacomelli giacomelli

🎮
gamedev
View GitHub Profile
@kevin-kientopp
kevin-kientopp / install-xclip
Created July 23, 2016 03:19
how to install xclip
$ sudo yum install epel-release.noarch
$ sudo yum install xclip
@wmeints
wmeints / ITemplateService.cs
Last active August 27, 2020 03:20
A template service based on the ASP.NET Core razor engine
/// <summary>
/// Renders email content based on razor templates
/// </summary>
public interface ITemplateService
{
/// <summary>
/// Renders a template given the provided view model
/// </summary>
/// <typeparam name="TViewModel"></typeparam>
/// <param name="filename">Filename of the template to render</param>
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
// This is only useful for spritesheets that need to be automatically sliced (Sprite Editor > Slice > Automatic)
public class AutoSpriteSlicer
{
[MenuItem("Tools/Slice Spritesheets %&s")]
@yasirkula
yasirkula / GradientGraphic.cs
Last active May 26, 2024 05:48
Create 4-color gradient UI graphics in Unity
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Sprites;
using UnityEngine.UI;
#if UNITY_2017_4 || UNITY_2018_2_OR_NEWER
using UnityEngine.U2D;
#endif
using Sprites = UnityEngine.Sprites;
#if UNITY_EDITOR
@SiarheiPilat
SiarheiPilat / ShortcutLevelLoader.cs
Last active May 9, 2021 18:26
Cycles through build scenes directly in the editor. Loads scenes in Unity according to their build order, using 'Shift' and left and right arrow keys.
#if UNITY_EDITOR
using UnityEditor;
using UnityEditor.SceneManagement;
// TODO: if the level is unchecked in build settings, the loop starts over
public class ShortcutLevelLoader
{
[MenuItem("Level loader/Load previous level &LEFT")]

How to make a 1 click connect to bluetooth device button

image

making a shortcut

  • Install Bluetooth Command Line Tools
  • you can use the command line tools to display all device ids by simply running btdiscovery
  • Create a Connect batch script:
@farukcan
farukcan / HierarchyWindowGroupHeader.cs
Last active September 18, 2023 08:19
Colorfull Hierarchy Window Group Header
using UnityEngine;
using UnityEditor;
/// <summary>
/// Colorful Hierarchy Window Group Header
/// Author: github.com/farukcan
/// Thanks for concept of idea :
/// http://diegogiacomelli.com.br/unitytips-hierarchy-window-group-header
/// Sample GameObject Names: "#red CAMERA" , "#" , "##E7A5F6 Hex" , "# "
/// </summary>