Skip to content

Instantly share code, notes, and snippets.

View gist:ed14974de0f5f3f5527b3f032da8a625
import subprocess
import os
import pkg_resources
def main():
try:
stdout = subprocess.check_output(['pyenv', 'versions'])
except subprocess.CalledProcessError as _:
print('pyenv is required.')
View scene-change.cs
using UnityEngine.SceneManagement;
// ...
void Update () {
if (Input.anyKeyDown){
SceneManager.LoadScene(sceneName, LoadSceneMode.Single);
}
}
@ones0318
ones0318 / follower.cs
Last active Oct 23, 2018
unity game script: follower
View follower.cs
void Update()
{
if(stop) return;
float dist = (transform.position - Player.transform.position).sqrMagnitude;
if (dist > 20)
{
// get closer to player
Vector3 direction = transform.position - Player.transform.position;
Vector3 bodyOffset = new Vector3(Player.GetComponentInChildren<SkinnedMeshRenderer>().bounds.extents.x, 0, Player.GetComponentInChildren<SkinnedMeshRenderer>().bounds.extents.z);