Skip to content

Instantly share code, notes, and snippets.

View GuilleUCM's full-sized avatar

Guillermo Jiménez GuilleUCM

View GitHub Profile
@GuilleUCM
GuilleUCM / SmoothFollow2D
Created April 2, 2015 09:46
Unity:Camera:Smooth Follow 2D
using UnityEngine;
using System.Collections;
public class SmoothFollow2D : MonoBehaviour {
//offset from the viewport center to fix damping
public float m_DampTime = 10f;
public Transform m_Target;
public float m_XOffset = 0;
public float m_YOffset = 0;
@GuilleUCM
GuilleUCM / gist:5661733
Last active October 13, 2023 20:31 — forked from entaroadun/gist:1653794
Recommendation datasets

Movies Recommendation:

Music Recommendation:

@GuilleUCM
GuilleUCM / ObjectShake.cs
Last active August 7, 2023 18:34
Unity:Animation:Shake object vibrate
using UnityEngine;
using System.Collections;
/// http://www.mikedoesweb.com/2012/camera-shake-in-unity/
public class ObjectShake : MonoBehaviour {
private Vector3 originPosition;
private Quaternion originRotation;
public float shake_decay = 0.002f;
@GuilleUCM
GuilleUCM / maxCamera.cs
Created June 24, 2013 20:33
Unity:Camera:Free camera control
//
//Filename: maxCamera.cs
//
// original: http://www.unifycommunity.com/wiki/index.php?title=MouseOrbitZoom
//
// --01-18-2010 - create temporary target, if none supplied at start
// - Pan = Ctrl + button
// - Orbit = Alt+button
// - Zoom = Alt + Ctrl + button
// - Reset = Space
@GuilleUCM
GuilleUCM / meyer-reset
Created December 5, 2013 13:45 — forked from hunt808/meyer-reset
CSS::Meyer reset
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
@GuilleUCM
GuilleUCM / BezierCurveDegree3.cs
Created June 24, 2013 20:43
Unity::Bezier curve degree 3
using UnityEngine;
using System.Collections;
public class BezierCurveDegree3 : MonoBehaviour {
public Vector3 m_startPoint;
public Vector3 m_endPoint;
public float m_time = 5.0f;
public float m_height = 1.0f;
@GuilleUCM
GuilleUCM / MenuItem.cs
Created June 9, 2013 10:29
Unity: Menu Item
using UnityEngine;
[RequireComponent (typeof (Collider))]
public class MenuItem: MonoBehaviour {
public KeyCode m_shortcut = KeyCode.Space;
public bool m_QuitButton = false;
public string m_levelName;
public Color m_colorNormal = Color.white;
public Color m_colorHighlighted = Color.red;
@GuilleUCM
GuilleUCM / CSharpSpatialHash.cs
Created May 11, 2013 09:30 — forked from sixman9/CSharpSpatialHash.cs
Unity: SpatialHash
/*
http://entitycrisis.blogspot.com/2010/02/spatial-hash-class-in-c.html
This is a rather useful class, the Spatial Hash. It is used for creating an index of spatial data (3D things in space) and allowing fast queries to be run against the index.
Effectively, you can use this class to ask, "I'm at this position, what other objects are near me?".
*/
using UnityEngine; //This needs to be 'removed' to make 'universal', i.e. not tied to Unity3D
using System.Collections;
@GuilleUCM
GuilleUCM / spin.cs
Created February 13, 2015 08:24
Unity:Animation:Spin rotation
using UnityEngine;
using System.Collections;
/// <summary>
/// Spins or rotates a gameObject around Y-axis (up)
/// </summary>
public class Spin : MonoBehaviour {
/// <summary>
/// Number of complete rotations per second
@GuilleUCM
GuilleUCM / Scale.cs
Created February 13, 2015 08:31
Unity:Animation:Scale
using UnityEngine;
using System.Collections;
/// <summary>
/// Scales proportionally a gameobject over the X and Z axis
/// </summary>
public class Scale : MonoBehaviour {
/// <summary>
/// The expected final scale (1.0f is the current scale)