Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Banane9 committed Dec 19, 2024
1 parent 5162403 commit 5845fed
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions CommunityBugFixCollection/CorrectMaterialGizmoScaling.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Elements.Core;
using FrooxEngine;
using HarmonyLib;
using MonkeyLoader.Resonite;
using System;
using System.Collections.Generic;
using System.Text;

namespace CommunityBugFixCollection
{
[HarmonyPatchCategory(nameof(CorrectMaterialGizmoScaling))]
[HarmonyPatch(typeof(MaterialGizmo), nameof(MaterialGizmo.PositionInFrontOfUser))]
internal sealed class CorrectMaterialGizmoScaling : ResoniteMonkey<CorrectMaterialGizmoScaling>
{
public override bool CanBeDisabled => true;

// Apply default scale for inspector UI before it gets user-scaled again by PositionInFrontOfUser
private static void Prefix(MaterialGizmo __instance)
=> __instance._inspectorRoot.Target.LocalScale = 0.0005f * float3.One;

private static bool Prepare() => Enabled;
}
}

0 comments on commit 5845fed

Please sign in to comment.