Skip to content

Instantly share code, notes, and snippets.

import subprocess
import os
import pkg_resources
def main():
try:
stdout = subprocess.check_output(['pyenv', 'versions'])
except subprocess.CalledProcessError as _:
print('pyenv is required.')
using UnityEngine.SceneManagement;
// ...
void Update () {
if (Input.anyKeyDown){
SceneManager.LoadScene(sceneName, LoadSceneMode.Single);
}
}
@ones0318
ones0318 / follower.cs
Last active October 23, 2018 15:54
unity game script: follower
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);