Skip to content

Instantly share code, notes, and snippets.

@nevernotsean
nevernotsean / pyenv-wsl-ubuntu_22.04.md
Created May 8, 2024 16:22 — forked from iambryancs/pyenv-wsl-ubuntu_22.04.md
Using Pyenv in WSL Ubuntu 22.04 LTS to install Python 3.8

Using Pyenv in WSL Ubuntu 22.04 LTS to install Python 3.8

Env

  • Windows 10
  • Ubuntu 22.04 WSL
  • zsh

Requirements

  • git
@nevernotsean
nevernotsean / FloatingOriginCinemachineCamera.cs
Created February 7, 2023 00:40
For use with the Dreamteck Forever asset. With the FloatingOrigin class, when the camera reaches a certain distance from the origin, it will move the entire LevelGenerator and children back to the world origin. This is to keep floating point precision in tact. Cinemachine doesnt like this, if there is any damping to your Virtual Camera body tran…
using System.Collections;
using Cinemachine;
using UnityEngine;
using Dreamteck.Forever;
[RequireComponent(typeof(CinemachineBrain))]
public class FloatingOriginCinemachineCamera : MonoBehaviour
{
CinemachineBrain brain;
CinemachineTransposer transposer;
@nevernotsean
nevernotsean / SplineRaycast.cs
Created July 17, 2022 21:04
Updated Spline Raycast with Unity Dreamteck Splines, adds support for raycasting across a closed Spline.
using System.Collections.Generic;
using UnityEngine;
namespace Dreamteck.Splines
{
static class SplineUtilities
{
/// <summary>
/// Casts a ray along the transformed spline against all scene colliders.
/// </summary>
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityAtoms.BaseAtoms;
public class UnityAtoms_UI_Hearts_Bar : MonoBehaviour
{
[SerializeField] private FloatVariable _Value;
public float Value { set { _Value.Value = value; } get { return _Value.Value; } }
@nevernotsean
nevernotsean / ObjectMinder.cs
Created August 16, 2019 17:45
Object Minder - Keeps In-Game Object Changes in Sync with Editor
//Made by Filmstorm - Author: Kieren Hovasapian
//Object Minder - Keeps In-Game Object Changes in Sync with Editor
using System.Collections;
using System.IO;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
[ExecuteInEditMode]
using System;
#if UNITY
using UnityEngine;
using Math = UnityEngine.Mathf;
#endif
static public class Easings
{
/// <summary>
/// Constant Pi.
@nevernotsean
nevernotsean / TinyTween.cs
Created March 18, 2019 21:15
A single file tween library in C# with support built in for XNA and Unity data types. MIT License.
// TinyTween.cs
//
// Copyright (c) 2013 Nick Gravelyn
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software
// and associated documentation files (the "Software"), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge, publish, distribute,
// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
@nevernotsean
nevernotsean / linearmap.js
Last active March 8, 2019 16:39 — forked from remy/map.js
function linearmap(x, in_min, in_max, out_min, out_max) {
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
@nevernotsean
nevernotsean / MouseCursorContext
Created August 24, 2018 14:43
MouseContext Component
import React, { Component } from 'react';
const {
Provider: MouseCursorProvider,
Consumer: MouseCursorContextConsumer
} = React.createContext();
export class MouseCursorContextProvider extends Component {
state = {
screenX: null,
@nevernotsean
nevernotsean / AddHierarchySeparator.cs
Created March 9, 2018 07:13
Place in Assets/Editor to give the Unity Object List Separators, Right click and add > Custom
/* MIT License Copyright (c) 2018 Uvi Vagabond, UnityBerserkers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE