Skip to content

Instantly share code, notes, and snippets.

using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
using UnityEngine.SceneManagement;
[InitializeOnLoad]
public static class ResetLightingDataAsset {
static ResetLightingDataAsset() {
EditorSceneManager.sceneOpened += OnSceneOpened;
@redseiko
redseiko / TinyTween.cs
Created December 24, 2023 20:40 — forked from FronkonGames/TinyTween.cs
A Complete and Easy to use Tweens library in One File.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// _____ _ _____
// |_ _|_|___ _ _ |_ _|_ _ _ ___ ___ ___
// | | | | | | | | | | | | | -_| -_| |
// |_| |_|_|_|_ | |_| |_____|___|___|_|_|
// |___|
// A Complete and Easy to use Tweens library in One File
//
// Basic use:
@redseiko
redseiko / MinimapPatch.cs
Last active June 28, 2022 21:50
Valheim: Minimap.GenerateWorldMapAsync
namespace Patches {
[HarmonyPatch(typeof(Minimap))]
public class MinimapPatch {
[HarmonyPostfix]
[HarmonyPatch(nameof(Minimap.Awake))]
static void AwakePostfix() {
_waterLevel = ZoneSystem.m_instance.m_waterLevel;
}
[HarmonyPrefix]
@redseiko
redseiko / Plugin.cs
Created August 30, 2021 20:53
Valheim: show message in top-left when saving a screenshot (default F11)
[HarmonyTranspiler]
[HarmonyPatch(nameof(GameCamera.ScreenShot))]
static IEnumerable<CodeInstruction> ScreenShotTranspiler(IEnumerable<CodeInstruction> instructions) {
return new CodeMatcher(instructions)
.MatchForward(
useEnd: false,
new CodeMatch(
OpCodes.Call,
AccessTools.Method(
typeof(ScreenCapture), nameof(ScreenCapture.CaptureScreenshot), new Type[] { typeof(string) })))