Skip to content

Instantly share code, notes, and snippets.

View ElasticSea's full-sized avatar
🌊
 splash.wav

Elastic Sea ElasticSea

🌊
 splash.wav
View GitHub Profile
@ElasticSea
ElasticSea / ExportMeshworld.cs
Last active February 12, 2022 18:28
Marble Race Meshworld exporter
using System;
using System.Linq;
using _Framework.Scripts.Extensions;
using _Project.Scripts.Entities.Zones;
using _Project.Scripts.Gameplay;
using Builder.Export.MeshWorld.GltfToMeshworld;
using UnityEngine;
using Object = UnityEngine.Object;
namespace Builder.Export.MeshWorld
@ElasticSea
ElasticSea / TransparentDepthPass.shader
Created June 3, 2021 20:34
Writes depth first to get rid of artifacts when multiple transparent faces overlap
Shader "Custom/Transparent Depth Pass" {
Properties {
_InnerColor("Inner Color", Color) = (1.0, 1.0, 1.0, 1.0)
_RimColor("Rim Color", Color) = (0.26, 0.19, 0.16, 0.0)
_RimPower("Rim Power", Range(0.5, 8.0)) = 3.0
}
SubShader {
Tags {
"Queue" = "Transparent"
"IgnoreProjector" = "True"
@ElasticSea
ElasticSea / BuildUtils.cs
Last active January 30, 2022 16:24
Builds active scenes and reveals the folder in explorer
#if UNITY_EDITOR
using System;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using UnityEditor;
using UnityEngine;
public class BuildUtils
{
@ElasticSea
ElasticSea / FixSkinnedMeshRendererBounds.cs
Last active August 15, 2019 18:49
Using cloth and skinned mesh renderer in 2018.4 messes up the renderer bounds. The renderer bounds end up being outside camera view and the object is culled and not rendered. Here is a quick fix how to force the renderer bounds to correct position. https://issuetracker.unity3d.com/issues/adding-cloth-component-to-skinnedmeshrenderer-changes-bounds
using UnityEngine;
namespace _Framework.Scripts.Util
{
public class FixSkinnedMeshRendererBounds : MonoBehaviour
{
[SerializeField] private SkinnedMeshRenderer skinnedMeshRenderer;
private void OnRenderObject()
{