mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
further cleanup of repo
This commit is contained in:
parent
4f8dcb0cd0
commit
323eb92f2e
140 changed files with 1 additions and 2430 deletions
81
.Deprecated/AvatarCloneTest/Main.cs
Normal file
81
.Deprecated/AvatarCloneTest/Main.cs
Normal file
|
@ -0,0 +1,81 @@
|
|||
using ABI_RC.Core;
|
||||
using ABI_RC.Core.EventSystem;
|
||||
using ABI_RC.Core.Savior;
|
||||
using MelonLoader;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NAK.AvatarCloneTest;
|
||||
|
||||
public class AvatarCloneTestMod : MelonMod
|
||||
{
|
||||
#region Melon Preferences
|
||||
|
||||
private static readonly MelonPreferences_Category Category =
|
||||
MelonPreferences.CreateCategory(nameof(AvatarCloneTest));
|
||||
|
||||
internal static readonly MelonPreferences_Entry<bool> EntryUseAvatarCloneTest =
|
||||
Category.CreateEntry("use_avatar_clone_test", true,
|
||||
"Use Avatar Clone", description: "Uses the Avatar Clone setup for the local avatar.");
|
||||
|
||||
internal static readonly MelonPreferences_Entry<bool> EntryCloneMeshRenderers =
|
||||
Category.CreateEntry("clone_mesh_renderers", false,
|
||||
"Clone Mesh Renderers", description: "Clones the mesh renderers from the original avatar to the clone.");
|
||||
|
||||
internal static readonly MelonPreferences_Entry<bool> EntryCopyBlendShapes =
|
||||
Category.CreateEntry("copy_blend_shapes", true,
|
||||
"Copy Blend Shapes", description: "Copies the blend shapes from the original avatar to the clone.");
|
||||
|
||||
internal static readonly MelonPreferences_Entry<bool> EntryCopyMaterials =
|
||||
Category.CreateEntry("copy_materials", true,
|
||||
"Copy Materials", description: "Copies the materials from the original avatar to the clone.");
|
||||
|
||||
#endregion Melon Preferences
|
||||
|
||||
#region Melon Events
|
||||
|
||||
public override void OnInitializeMelon()
|
||||
{
|
||||
ApplyPatches(typeof(Patches)); // slapped together a fix cause HarmonyInstance.Patch was null ref for no reason?
|
||||
}
|
||||
|
||||
public override void OnUpdate()
|
||||
{
|
||||
// press f1 to find all cameras that arent tagged main and set them tno not render CVRLayers.PlayerClone
|
||||
if (Input.GetKeyDown(KeyCode.F1))
|
||||
{
|
||||
foreach (var camera in UnityEngine.Object.FindObjectsOfType<UnityEngine.Camera>())
|
||||
{
|
||||
if (camera.tag != "MainCamera")
|
||||
{
|
||||
camera.cullingMask &= ~(1 << CVRLayers.PlayerClone);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if pressing ctrl + r, reload avatar
|
||||
if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.R))
|
||||
{
|
||||
var player = MetaPort.Instance.currentAvatarGuid;
|
||||
AssetManagement.Instance.LoadLocalAvatar(player);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Melon Events
|
||||
|
||||
#region Melon Mod Utilities
|
||||
|
||||
private void ApplyPatches(Type type)
|
||||
{
|
||||
try
|
||||
{
|
||||
HarmonyInstance.PatchAll(type);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LoggerInstance.Msg($"Failed while patching {type.Name}!");
|
||||
LoggerInstance.Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Melon Mod Utilities
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue