Skip to content

Instantly share code, notes, and snippets.

View Ardaurum's full-sized avatar
💻
You can't rest here enemies are nearby

Ardaurum Ardaurum

💻
You can't rest here enemies are nearby
View GitHub Profile
@Ardaurum
Ardaurum / RuntimeMesh.cs
Created July 28, 2020 06:21
Serializing mesh in a component
using UnityEngine;
namespace Ard.Procedural
{
[ExecuteInEditMode]
[RequireComponent(typeof(MeshFilter))]
public sealed class RuntimeMesh : MonoBehaviour
{
[SerializeField] [HideInInspector] private Vector3[] _vertices;
[SerializeField] [HideInInspector] private Vector3[] _normals;
@Ardaurum
Ardaurum / EditorObjectHighlight.cs
Last active May 9, 2021 18:20
`EditorObjectHighlight.cs` is the core that stores objects to highlight and renders them. There's also an `EditorObjectHighlight.shader` which is a transparent one color shader and can be easily extended. The `HighlightOnHover.cs` is an example usage of `EditorObjectHighlight`.
using System.Collections.Generic;
using UnityEngine;
namespace Ard.Tools
{
[InitializeOnLoad]
public static class EditorObjectHighlight
{
private static readonly List<HighlightObject> _highlights;
@Ardaurum
Ardaurum / CheckAddressNameTooLong.cs
Last active April 24, 2020 11:22
Analyze rule for addressables to see if the name is too long. It is useful for Windows platform which has a character limit of 260 characters in a path, so too long paths might fail a build. It avoids duplicates in names after making them shorter which might not be ideal for your setup (names can be duplicated using labels to load addressables)!
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.AddressableAssets.Build;
using UnityEditor.AddressableAssets.Build.AnalyzeRules;
using UnityEditor.AddressableAssets.Settings;
namespace Blindflug.MemoryManagement.Editor
{
public sealed class CheckAddressNameTooLong : AnalyzeRule
{