Skip to content

Instantly share code, notes, and snippets.

View Stektpotet's full-sized avatar
🎯
Focusing

Halvor Stektpotet

🎯
Focusing
  • Norwegian University of Science and Technology, SINTEF Ocean
  • Trondheim, Norway
View GitHub Profile
@Stektpotet
Stektpotet / Grid.cs
Last active August 29, 2015 14:26
GL tool for showing grids
using UnityEngine;
using System.Collections;
public class Grid : MonoBehaviour
{
public static float gridSize = 0.5f;
public static Vector2 ToGrid( Vector2 point )
{
float xStep = Mathf.Floor((point.x / gridSize) + 0.5f);
[RequireComponent(typeof(Rigidbody2D))]
public abstract class TimeDilated : MonoBehaviour
{
private float _time = 0;
public float localTime { get{ return _time; } set{_time = value;} }
public Vector2 velocity;
protected Vector2 _dilationForce = Vector2.zero; //acceleration
public Vector2 acceleration{ get{ return _dilationForce; } set { _dilationForce = value; } }