This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
/// <summary> | |
/// Responsive Camera Scaler | |
/// </summary> | |
public class CameraAspectRatioScaler : MonoBehaviour { | |
/// <summary> | |
/// Reference Resolution like 1920x1080 | |
/// </summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Internationalization | |
* | |
* Author: Daniel Erdmann | |
* | |
* 1. Add this File to you Project | |
* | |
* 2. Add the language files to the folder Assets/Resources/I18n. (Filesnames: en.txt, es.txt, pt.txt, de.txt, and so on) | |
* Format: en.txt: es.txt: | |
* =============== ================= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Detects clicks on game objects | |
* | |
* 1. Attach ClickDetector component to a camera or a "game manager" object | |
* 2. Attach a collider (e.g. BoxCollider) to all objects that should receive a on click event | |
* 3. Attach a MonoBehaviour to all objects that should receive a on click event registering to the event. | |
* | |
* The MonoBehavior should have at least: | |
* | |
* public class ClickableGameObject : MonoBehaviour, ClickDetector.ClickDetectorListener |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* RotateObject | |
* | |
* Author: Daniel Erdmann | |
* | |
* 1. Add this File to you Project | |
* | |
* 2. Put it on an object | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System; | |
public class MathParabola | |
{ | |
public static Vector3 Parabola(Vector3 start, Vector3 end, float height, float t) | |
{ | |
Func<float, float> f = x => -4 * height * x * x + 4 * height * x; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Rotates an object towards the currently active camera | |
* | |
* 1. Attach CameraBillboard component to a canvas or a game object | |
* 2. Specify the offset and you're done | |
* | |
**/ | |
using UnityEngine; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.IO; | |
public class FileManager | |
{ | |
/// <summary> | |
/// Load File | |
/// </summary> | |
/// <typeparam name="T">Data Model Type</typeparam> | |
/// <param name="filename">File Name</param> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
/* | |
* Moving Platform | |
* | |
* 1. Attach WayPointPath to an empty game object | |
* 2. Create empty game object children (these will be handled as waypoints) | |
* 3. Attach Platform component to a game object and assign the WayPointPath | |
* | |
* | |
**/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.IO; | |
using UnityEngine; | |
public class Paintable : MonoBehaviour { | |
public GameObject Brush; | |
public float BrushSize = 0.1f; | |
public RenderTexture RTexture; |
OlderNewer