Skip to content

Instantly share code, notes, and snippets.

View BitKingRo's full-sized avatar

BitKing BitKingRo

View GitHub Profile
@BitKingRo
BitKingRo / SingletonScriptableObject.cs
Created December 20, 2017 00:56 — forked from dvddarias/SingletonScriptableObject.cs
Better Unity Singleton Class
/************************************************************
* Better Singleton by David Darias
* Use as you like - credit where due would be appreciated :D
* Licence: WTFPL V2, Dec 2014
* Tested on Unity v5.6.0 (should work on earlier versions)
* 03/02/2017 - v1.1
* **********************************************************/
using System;
using UnityEngine;
@BitKingRo
BitKingRo / Arrows2DMovement.cs
Created December 20, 2017 00:54 — forked from dvddarias/Arrows2DMovement.cs
Unity editor script to precisely move, rotate and scale GameObjects on a 2D scene, using the arrow keys.
/*
Unity editor script to precisely move, rotate and scale GameObjects on 2D scenes, using the arrow keys.
Notes:
- To use it just include it on an "Assets/Editor" folder on your project.
- The action depends on the selected tool and the size of the movement depends on the Scene view zoom.
- The more "zoomed in" is the scene view the smaller is the movement step.
- It will work when the current Scene tab is in 2D mode and there is at least one gameObject selected,
otherwise the scene camera will move as usual :)
@BitKingRo
BitKingRo / QuitApplication.cs
Created August 13, 2017 14:09
Quit Application
public void ExitGame()
{
Application.Quit();
}
@BitKingRo
BitKingRo / SceneManager.cs
Created August 13, 2017 10:51
Scene Manager
public void ChangeLevel(string level){
SceneManager.LoadScene(level);
}
@BitKingRo
BitKingRo / distance.cs
Last active July 1, 2017 11:22
Distance from one object to another Unity3d.
float distance = Vector3.Distance (object1.transform.position, object2.transform.position);