Skip to content

Instantly share code, notes, and snippets.

[CustomEditor(typeof(Test))]
public class TestEditor : Editor
{
public override VisualElement CreateInspectorGUI()
{
var container = new VisualElement();
container.Add(new IMGUIContainer(OnInspectorGUI));
container.Add(new Label("Test"));
using UnityEngine;
using System.Collections;
public class ShakeTransformS : MonoBehaviour
{
[Header("Info")]
private Vector3 _startPos;
private float _timer;
private Vector3 _randomPos;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.SceneManagement;
//http://wiki.unity3d.com/index.php?title=Floating_Origin
public class FloatingPointOriginMoveS : MonoBehaviour {
[Header("Settings")]
[Tooltip("When Target's position reaches this magnitude/distance, Target and Scene Root transforms will be moved.")]
@st4rdog
st4rdog / TreeReplacerS.cs
Created March 14, 2019 06:38
Replaces trees on a terrain with prefab.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
// Replaces Unity terrain trees with prefab GameObject.
// http://answers.unity3d.com/questions/723266/converting-all-terrain-trees-to-gameobjects.html
[ExecuteInEditMode]
public class TreeReplacerS : EditorWindow {
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Vectrosity;
public class BlinkScript : MonoBehaviour {
public bool bLogStateChanges;
public enum State
using UnityEngine;
using System.Collections;
public class LightmapPixelPicker : MonoBehaviour {
public Color surfaceColor;
public float brightness1; // http://stackoverflow.com/questions/596216/formula-to-determine-brightness-of-rgb-color
public float brightness2; // http://www.nbdtech.com/Blog/archive/2008/04/27/Calculating-the-Perceived-Brightness-of-a-Color.aspx
public LayerMask layerMask;
@st4rdog
st4rdog / MipMapBiasAdjusterS.cs
Created November 16, 2017 20:00
Sharpen blurry mipmaps in Unity
using UnityEngine;
using System.Collections;
public class MipMapBiasAdjusterS : MonoBehaviour {
[Header("Settings")]
[Tooltip("A positive bias makes a texture appear extra blurry, while a negative bias sharpens the texture. Note that using large negative bias can reduce performance, so it's not recommended to use more than -0.5 negative bias.)")]
public float _target = -2f;
[Tooltip("Adjust all textures found in scene?")]
public bool _allTexturesOnStart;
<?xml version="1.0" encoding="Windows-1252" ?>
<!-- Be careful of XML formatters that remove \n line endings from attributes -->
<!--
Includes events and functions, up to the stated version, from:
Skyrim 1.9.32.0.8
SKSE 1.6.16
SkyUI SDK 4.1
Events/functions that require anything beyond Skyrim state the additional
requirements explicitly in their descriptions.
using UnityEngine;
using System.Collections;
public class PlayerMoveS : MonoBehaviour {
[Header("Settings")]
public float speed = 10f;
// COMPONENTS
private CharacterController cc;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class RewindManager : MonoBehaviour
{
//============================================
// FUNCTIONS (CUSTOM)