Skip to content

Instantly share code, notes, and snippets.

Levin G. Seneral

Block or report user

Report or block Seneral

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Seneral
Seneral / TerrainMeshVisualizer.cs
Last active Mar 22, 2019
Fast and simple way to visualize terrain heightmaps in Unity 3D - simple offset surface shader included - to use, assign material properties per script and use TerrainMeshVisualizer.DrawVisualization to draw a temporary visualization
View TerrainMeshVisualizer.cs
using UnityEngine;
[System.Serializable]
public class TerrainMeshVisualizer
{
public Material material;
private const int tileRes = 128;
private Mesh _tileMesh;
@Seneral
Seneral / SerializableAction.cs
Last active Mar 11, 2019
Fully capable SerializableAction for Unity. Supports targets of both UnityEngine.Object and System.Object and one-layer serialization of unserializable types. Supports static and generic methods and classes; Supports most anonymous actions, fully capable of using the context. Support: forum.unity3d.com/threads/406299
View SerializableAction.cs
namespace SerializableActionHelper
{
using UnityEngine;
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Reflection;
@Seneral
Seneral / GUIScaleUtility.cs
Last active Jan 13, 2019
Advanced GUI scaling for Unity. Fixes problems with unscaled clipping rect using reflection. Allows for custom zoom positions other than (0,0). Need all elements to offset by a specified value to account for zoom position and scale though. Example of use is my open source Node Editor Framework
View GUIScaleUtility.cs
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
using System.Reflection;
namespace NodeEditorFramework.Utilities
{
public static class GUIScaleUtility
@Seneral
Seneral / EditorLoadingControl.cs
Last active Nov 21, 2018
Extended editor callbacks for entering/leaving playmode and new scenes in Unity
View EditorLoadingControl.cs
#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;
#if UNITY_5_3_OR_NEWER || UNITY_5_3
using UnityEngine.SceneManagement;
using UnityEditor.SceneManagement;
#endif
using System;
@Seneral
Seneral / RTEditorGUI.cs
Last active May 19, 2018
Extended editor GUI controls for runtime usage in Unity. Includes runtime-compatible editor control ports, new controls and fields, advanced texture drawing utilities, general texture utilities and efficient clipped bezier drawing. Bezier drawing needs line texture www.dropbox.com/s/2qn3q3nwhny17ok and (optional) GUIScaleUtility gist
View RTEditorGUI.cs
using UnityEngine;
using System;
using System.Globalization;
using System.Linq;
using System.Collections.Generic;
using Object = UnityEngine.Object;
namespace NodeEditorFramework.Utilities
{
@Seneral
Seneral / PoseManager.cs
Last active May 9, 2018
Allows to save, export, import and restore a SkinnedMeshRenderer's bone transformation state (aka pose). This includes resetting to the initial model pose. Put PoseManagerEditor.cs in an editor folder.
View PoseManager.cs
using UnityEngine;
using System;
using System.Linq;
using System.Collections.Generic;
[ExecuteInEditMode]
public class PoseManager : MonoBehaviour
{
public SkinnedMeshRenderer skinnedRenderer;
public List<RigPose> poses = new List<RigPose> ();
@Seneral
Seneral / ConvertSerializationVersion.cs
Last active Dec 2, 2017
Script to convert files serialized in 5.5 to previous unity versions based on the text format. 1. Enable force text serialization in ProjectSettings/Editor 2. Right click on the asset in the version it was serialized in and select the target version. 3. Move the created file with the _Converted suffix into the target project.
View ConvertSerializationVersion.cs
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
public static class ConvertSerializationVersion
{
private static Regex objectIDSearch = new Regex("--- !u!(?:[0-9]{1,5}) &([0-9]*)");
You can’t perform that action at this time.