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 / 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]*)");
@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 / 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 / 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 Jun 18, 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 / PoseManager.cs
Last active Aug 5, 2019
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 / 149909-playlist_youtube.lua
Created Jul 28, 2019
Modified VLC YouTube playlist parsing script to support playlists with more than 200 videos. Verified it works with 1000+ videos, no duplicates and all included (minus deleted videos). Official version claims to support 100+, but actually only works up until 200 videos. https://addons.videolan.org/content/show.php/+Youtube+playlist?content=149909
View 149909-playlist_youtube.lua
--[[
Youtube playlist importer for VLC media player 1.1 and 2.0
Copyright 2012 Guillaume Le Maout
Authors: Guillaume Le Maout
Contact: http://addons.videolan.org/messages/?action=newmessage&username=exebetche
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
@Seneral
Seneral / RTEditorGUI.cs
Last active Aug 20, 2019
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
{
You can’t perform that action at this time.