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
transform.position = Vector3.lerp(transform.position, target.position, Time.deltaTime) | |
// Or sometimes with an arbitrary multiplier to time, changing the lerp rate. | |
float lerpMod = ???; // Some formula | |
transform.position = Vector3.lerp(transform.position, target.position, Time.deltaTime * lerpMod) |
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
while (lerpCompletion < 0.99) | |
{ | |
lerpCompletion += Time.smoothDeltaTime * lerpMultiplier; | |
var curveValue = curve.Evaluate(lerpCompletion); | |
transform.localRotation = Quaternion.Slerp(_currentRotation, _desiredRotation, curveValue); | |
yield return null | |
} |
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
public AnimationCurve curve; | |
void Start() | |
{ | |
curve = GetComponent<AnimationCurve>(); | |
} |
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
/// <summary> | |
/// This rotates the camera to match the orientation of the phone | |
/// </summary> | |
public void TiltPhone() | |
{ | |
// Helps to stop us getting caught in a bad change of states. Resets in ResetRotation(). | |
if (!tilting) | |
{ | |
// Save our current rotation before doing anything else. This is where we'll return later. |
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
#!/usr/bin/env python | |
from bs4 import BeautifulSoup | |
from twilio.rest import TwilioRestClient | |
import json | |
import os | |
import re | |
import requests | |
url = 'https://postmates.com/los-angeles' |
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; | |
public class DebugDrawGameObjectMesh : MonoBehaviour | |
{ | |
[Header("Configuration")] | |
[Space] | |
public bool drawWireMesh = true; | |
public Color wireColor = new Color(0, 0, 0, .8f); |
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
# Mathieu Blondel, September 2010 | |
# License: BSD 3 clause | |
import numpy as np | |
from numpy import linalg | |
import cvxopt | |
import cvxopt.solvers | |
def linear_kernel(x1, x2): | |
return np.dot(x1, x2) |
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.Generic; | |
public static class Extensions | |
{ | |
// Collections | |
public static T RandomItem<T>(this T[] input) // do arrays and list share a type? | |
{ | |
return input[Random.Range(0, input.Length - 1)]; | |
} |
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
// Logic created by @DanInFiction on Twitter, I stole it to make an extension method. | |
using UnityEngine; | |
using System.Collections; | |
public static class LookAt2D_Extension { | |
public static void LookAt2D(this Transform self, Transform target){ | |
self.right = target.position - self.position; |
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; | |
public interface IOptionsItem {} | |
public class OptionsItem : IOptionsItem { | |
override public string ToString() { | |
return "OptionsItem"; | |
} | |
} |
NewerOlder