-
Notifications
You must be signed in to change notification settings - Fork 9
/
HelperClasses.cs
68 lines (65 loc) · 2.01 KB
/
HelperClasses.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using System;
using System.Collections.Generic;
using System.Text;
using BepInEx;
using BepInEx.Configuration;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.Orbs;
using UnityEngine;
using Hex3Mod;
using Hex3Mod.Logging;
namespace Hex3Mod.HelperClasses
{
public class helpers
{
public static GameObject PrepareItemDisplayModel(GameObject itemDisplayModel)
{
// I snatched this from Mystics Items, I'd prefer to make my own but I'm unity inept
ItemDisplay itemDisplay = itemDisplayModel.AddComponent<ItemDisplay>();
List<CharacterModel.RendererInfo> rendererInfos = new List<CharacterModel.RendererInfo>();
foreach (Renderer renderer in itemDisplayModel.GetComponentsInChildren<Renderer>())
{
CharacterModel.RendererInfo rendererInfo = new CharacterModel.RendererInfo
{
renderer = renderer,
defaultMaterial = renderer.material
};
rendererInfos.Add(rendererInfo);
}
itemDisplay.rendererInfos = rendererInfos.ToArray();
return itemDisplayModel;
}
}
public static class UltimateCustomRunCompatibility
{
private static bool? _enabled;
public static bool enabled
{
get
{
if (_enabled == null)
{
_enabled = BepInEx.Bootstrap.Chainloader.PluginInfos.ContainsKey("HIFU.UltimateCustomRun");
}
return (bool)_enabled;
}
}
}
public static class VanillaRebalanceCompatibility
{
private static bool? _enabled;
public static bool enabled
{
get
{
if (_enabled == null)
{
_enabled = BepInEx.Bootstrap.Chainloader.PluginInfos.ContainsKey("Hayaku.VanillaRebalance");
}
return (bool)_enabled;
}
}
}
}