Skip to content

Instantly share code, notes, and snippets.

View nicoplv's full-sized avatar

Nicolas Pierre-Loti-Viaud nicoplv

View GitHub Profile
@nicoplv
nicoplv / ClearFxPrefab.cs
Created May 31, 2023 22:47
Script to clear FX prefab
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace Utils
{
public class ClearFxPrefab
{
#region Methods
@nicoplv
nicoplv / CurvyFix.cs
Last active April 4, 2023 09:43
A fix to curvy spline, to be able to use spline inside prefab without having a curvyglobal in the opened scene
#if UNITY_EDITOR
using System;
using System.Collections;
using System.Collections.Generic;
using FluffyUnderware.Curvy;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEditor;
using UnityEditor.SceneManagement;
@nicoplv
nicoplv / ProgressBarHelper
Created January 18, 2023 13:21
An helper to be able to use the Unity Progress Bar with background or async operations
[UnityEditor.InitializeOnLoad]
public class ProgressBarHelper
{
#region Methods
protected static List<Action> actions = new List<Action>();
static ProgressBarHelper()
{
UnityEditor.EditorApplication.update += Update;
@nicoplv
nicoplv / CleanDuplicateName.cs
Last active December 8, 2023 20:22
A little script to get a clean name after a duplication or a copy of a gameobject in your unity scene. Drag and drop it into an editor folder !
using System.Text.RegularExpressions;
using UnityEditor;
using UnityEngine;
[InitializeOnLoad]
public class CleanDuplicateName
{
static bool eventDuplicateAppend;
static CleanDuplicateName()
@nicoplv
nicoplv / ReimportAsset.cs
Last active May 18, 2018 10:06
Automatize the reimportation of working file from a folder ended with '~' (a demo video is available here https://youtu.be/S-yyK3Fzw3c)
using UnityEngine;
using UnityEditor;
using System.Text.RegularExpressions;
using System.IO;
public class ReimportAsset : MonoBehaviour
{
#region MenuItem Methods
[MenuItem("Assets/Reimport from ~ &R", false, priority = 40)]
@nicoplv
nicoplv / DebugPanel.cs
Created March 13, 2018 10:22
Debug Panel for Unity - To debug your variables more easily
using System.Collections.Generic;
using UnityEngine;
namespace SmartUnity.Debugs
{
public class DebugPanel
{
#region Variables
private static DebugPanel debugPanel;
@nicoplv
nicoplv / 0-UnityScriptTemplates.info
Last active April 29, 2024 12:56
List of C# Script Templates for Unity 3D
List of C# Script Templates for Unity 3D:
81-C#__Behavior-NewBehaviour.cs.txt
81-C#__BehaviorListed-NewBehaviourListed.cs.txt
81-C#__Class-NewClass.cs.txt
81-C#__Interface-NewInterface.cs.txt
81-C#__ScriptableObject-NewScriptableObject.cs.txt
@nicoplv
nicoplv / MobileDecalShadow.shader
Created September 5, 2017 17:08
A mobile decal shadow shader for Unity
Shader "Mobile/Decal Shadow" {
Properties{
_MainTex("Base (RGB)", 2D) = "white" {}
_alpha("AlphaMulti", Range(0,1)) = 1
}
SubShader{
Tags { "RenderType" = "Opaque" "Queue" = "Geometry+1" "ForceNoShadowCasting" = "True" }
LOD 200
Offset -1, -1
@nicoplv
nicoplv / GroupUtility.cs
Created August 25, 2017 09:58
Group maker for Unity Editor
using UnityEditor;
using UnityEngine;
namespace SmartEditor
{
public class GroupUtility : Editor
{
[MenuItem("Edit/Group %g", false, 0)]
public static void Group()
{
@nicoplv
nicoplv / PlayMode.cs
Last active February 27, 2024 03:15
Full screen game view on Unity editor (works only with 2017.2 or +)
using UnityEditor;
using UnityEngine;
namespace FullScreenPlayModes
{
[InitializeOnLoad]
public class FullScreenPlayMode : Editor
{
//The size of the toolbar above the game view, excluding the OS border.
private static int toolbarHeight = 22;