mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 14:29:25 +00:00
Invoke time is now 0f, so toggling and refreshing Gizmos are now instant... oops. GizmosInstance is now properly disabled when not in use. Also removed the default gizmos line drawing at 0,0,0 that was purely there to clear gizmos queue. CVRAvatar debugging now has useful lines coming from the viewpoint and mouth positions. Later on might actually parent these gizmos to the head : shrug :
58 lines
No EOL
1.7 KiB
C#
58 lines
No EOL
1.7 KiB
C#
using CVRGizmos.GismoTypes;
|
|
using Gizmos = Popcron.Gizmos;
|
|
using UnityEngine;
|
|
|
|
namespace CVRGizmos
|
|
{
|
|
public class CVRGizmoManager : MonoBehaviour
|
|
{
|
|
public static CVRGizmoManager Instance;
|
|
|
|
public bool g_enabled = false;
|
|
public bool g_localOnly = false;
|
|
|
|
public MonoBehaviour[] managed;
|
|
|
|
public System.Type[] GizmoTypes = {
|
|
typeof(CVRGizmos_Pointer),
|
|
typeof(CVRGizmos_AdvancedAvatarSettingsTrigger),
|
|
typeof(CVRGizmos_SpawnableTrigger),
|
|
typeof(CVRGizmos_AdvancedAvatarSettingsPointer),
|
|
typeof(CVRGizmos_DistanceLod),
|
|
typeof(CVRGizmos_HapticZone),
|
|
typeof(CVRGizmos_HapticAreaChest),
|
|
typeof(CVRGizmos_ToggleStateTrigger),
|
|
typeof(CVRGizmos_Avatar),
|
|
typeof(CVRGizmos_AvatarPickupMarker),
|
|
typeof(CVRGizmos_DistanceConstrain),
|
|
};
|
|
|
|
void Start()
|
|
{
|
|
CVRGizmoManager.Instance = this;
|
|
managed = new MonoBehaviour[GizmoTypes.Count()];
|
|
for (int i = 0; i < GizmoTypes.Count(); i++)
|
|
{
|
|
managed[i] = gameObject.AddComponent(GizmoTypes[i]) as MonoBehaviour;
|
|
}
|
|
}
|
|
|
|
public void EnableGizmos(bool able)
|
|
{
|
|
for (int i = 0; i < GizmoTypes.Count(); i++)
|
|
{
|
|
managed[i].enabled = able;
|
|
Gizmos.Enabled = able;
|
|
}
|
|
RefreshGizmos();
|
|
}
|
|
|
|
public void RefreshGizmos()
|
|
{
|
|
for (int i = 0; i < GizmoTypes.Count(); i++)
|
|
{
|
|
managed[i].Invoke("CacheGizmos", 0f);
|
|
}
|
|
}
|
|
}
|
|
} |