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; | |
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; |
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; | |
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; |
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; | |
using System.Collections.Generic; | |
using Vectrosity; | |
public class BlinkScript : MonoBehaviour { | |
public bool bLogStateChanges; | |
public enum State |
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; | |
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 { |
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; | |
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.")] |
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; | |
public class ShakeTransformS : MonoBehaviour | |
{ | |
[Header("Info")] | |
private Vector3 _startPos; | |
private float _timer; | |
private Vector3 _randomPos; |
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
[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")); | |
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; | |
using UnityEngine.UI; | |
namespace UIGradient | |
{ | |
[AddComponentMenu("UI/Effects/Gradient")] | |
public class Gradient : BaseMeshEffect | |
{ |
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
// Created by lordofduct - https://forum.unity.com/threads/recommended-event-system.856294/#post-5644981 | |
// | |
// Usage example: | |
// | |
// public delegate void OnDiedEvent(GameObject go); | |
// | |
// Messaging<OnDiedEvent>.Trigger?.Invoke(gameObject); | |
// | |
// Messaging<OnDiedEvent>.Register(go => { | |
// Debug.Log($"{go.name} died."); |
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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class SmoothMouseLook : MonoBehaviour | |
{ | |
private List<float> _xBuffer = new List<float>(); | |
private List<float> _yBuffer = new List<float>(); | |
private int _bufferIndex; |