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; | |
// Functions taken from Tween.js - Licensed under the MIT license at https://github.com/sole/tween.js | |
public static class Easing | |
{ | |
public enum EasingType | |
{ | |
Linear, | |
SineIn, | |
SineOut, |
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; | |
using System.Collections.Generic; | |
using System.IO; | |
using UnityEngine; | |
/// <summary> | |
/// A replacement for Unity's PlayerPrefs that stores data in a JSON file. | |
/// </summary> | |
[Serializable] | |
public class JsonPlayerPrefs |
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.Collections; | |
public class TrajectoryCalculation : MonoBehaviour | |
{ | |
public Rigidbody projectile; | |
public Transform target; | |
[Header("CalculateBestThrowSpeed")] | |
public float timeToTarget = 1f; | |
[Header("CalculateTrajectory")] |
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.Collections; | |
// On first-person controllers, the camera and body are separate objects, | |
// so to perform a smooth look-at, they must rotate along different axes, in unison. | |
// NOTE: You will likely have to disable the look/camera controller in order for this to work. | |
public class FirstPersonLookAt : MonoBehaviour | |
{ | |
public Transform body; |
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.Collections; | |
// based on http://unitytipsandtricks.blogspot.com/2013/05/camera-shake.html | |
public class PerlinShake : MonoBehaviour | |
{ | |
public float duration = 2f; | |
public float speed = 20f; | |
public float magnitude = 2f; | |
public AnimationCurve damper = new AnimationCurve(new Keyframe(0f, 1f), new Keyframe(0.9f, .33f, -2f, -2f), new Keyframe(1f, 0f, -5.65f, -5.65f)); |