Skip to content

Instantly share code, notes, and snippets.

View SanielX's full-sized avatar

Alex SanielX

View GitHub Profile
@SanielX
SanielX / BlendableValue.cs
Created November 13, 2020 22:06
Sometimes I want to change some value like "PlayerCanRun" without overriding it's actual value so I can return to it later. Also this helps dealing with situations when a lot systems could write to same value
using UnityEngine;
using System.Collections.Generic;
namespace HostGame.Utilities
{
[System.Serializable]
public abstract class BlendableValue<T>
{
protected List<BlenderOf<T>> Blenders = new List<BlenderOf<T>>();
@SanielX
SanielX / PrepareTerrainForNavmeshBake.cs
Created June 1, 2020 18:54
Small script I made to raplace all trees on terrain with something better for navmesh.
/*
I assumed all trees have capsule colliders so you'll need one on tree or in children.
Also tree prefab must be marked as Navmesh static
Undo is not implemented here, so use it carefully
*/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace HostGame