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
-- a cloud chamber by nothke | |
-- with an accidental colorful spread | |
-- see "ACCIDENT" | |
function _init() | |
cls(); | |
end | |
function _update() | |
-- unused |
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 AeroSurface : MonoBehaviour | |
{ | |
public Rigidbody rb; | |
void Start() |
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; | |
[ExecuteInEditMode] | |
public class GridNoiseCells : MonoBehaviour | |
{ | |
[Header("Starting cell offset")] | |
public int currentX = 0; | |
public int currentY = 0; |
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 UnityEditor; | |
public class SerializedPropTrick : MonoBehaviour | |
{ | |
// (the dummy class | |
[System.Serializable] | |
public class SomeClass | |
{ |
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; | |
public static class GameObjectExtensions | |
{ | |
public static T GetOrAddComponent<T>(this GameObject gameObject) where T : Component | |
{ | |
T component = gameObject.GetComponent<T>(); | |
if (component == null) component = gameObject.AddComponent<T>(); | |
return (T)component; |
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
/// Normalmap exporter for Unity | |
/// | |
/// IMPORTANT: Must be put into Editor folder to work | |
/// | |
/// Right click on a texture in assets window and click on 'Export Normalmap...' | |
/// Can only export normal maps as it shifts channels | |
/// | |
/// Original script by Eric5h5 | |
/// Rewritten to C# and updated by Nothke | |
/// |
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
public Transform CreatePreview(Transform prefab, Material previewMaterial) | |
{ | |
// Instantiate the prefab | |
Transform t = Instantiate(prefab); | |
// Set all materials to preview material | |
foreach (var renderer in t.GetComponentsInChildren<Renderer>(true)) | |
renderer.sharedMaterial = previewMaterial; | |
// Destroy all other non-rendering related components |
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; | |
public class HoverAtPointInSpaceExample : MonoBehaviour | |
{ | |
public VectorPid pid = new VectorPid(10, 5, 5); | |
public Vector3 target = new Vector3(0, 2, 0); | |
Rigidbody _rb; | |
Rigidbody rb { get { if (!_rb) _rb = GetComponent<Rigidbody>(); return _rb; } } |
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 UnityEngine; | |
using System.Threading; | |
public class ThreadingExample : MonoBehaviour | |
{ | |
Thread myThread; | |
// This is where we'll put the value of threading result |
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; | |
using UnityEngine.UI; | |
public class RandomRomanianNam : MonoBehaviour | |
{ | |
public Text text; |