change initialization approach, refactoring

should resolve errors occurring on both Atlas and WurstMod maps
This commit is contained in:
msk
2023-07-31 02:32:02 -07:00
parent 73d8a5b89d
commit b87db514a5
7 changed files with 49 additions and 51 deletions
+9
View File
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: a7e0925cb0a2d20488bcb5d230cf74f7
folderAsset: yes
timeCreated: 1690792321
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
+5 -5
View File
@@ -1,11 +1,10 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine;
using UnityEngine.UI;
using FistVR;
// To be attached to FVRHealthBar object
public class HPHideWhenAiming : MonoBehaviour {
public class HPHideWhenAiming : MonoBehaviour
{
CanvasGroup canvasGroup;
GameObject gObjHUD;
@@ -25,7 +24,8 @@ public class HPHideWhenAiming : MonoBehaviour {
//LineRenderer colliderRenderer;
// Use this for initialization
void Start() {
void Start()
{
gObjHUD = transform.GetChild(0).gameObject;
leftHand = MeatKitPlugin.playerCamera.transform.parent.GetChild(1).GetComponent<FVRViveHand>();
rightHand = MeatKitPlugin.playerCamera.transform.parent.GetChild(0).GetComponent<FVRViveHand>();
+1 -4
View File
@@ -1,6 +1,4 @@
using HarmonyLib;
using System.Reflection;
using UnityEngine;
using UnityEngine;
using FistVR;
namespace TNHQoLImprovements
@@ -32,7 +30,6 @@ namespace TNHQoLImprovements
void OnDestroy()
{
// Destroy statics
tnhManager = null;
}
}
+2 -2
View File
@@ -95,8 +95,8 @@ namespace TNHQoLImprovements
private void Update()
{
// game over area; do not update anything else
if (InPlay.tnhManager.Phase == TNH_Phase.Dead || InPlay.tnhManager.Phase == TNH_Phase.Completed)
// game over area; do not update anything else
if (InPlay.tnhManager.Phase == TNH_Phase.Dead || InPlay.tnhManager.Phase == TNH_Phase.Completed)
{
if (tokenCounter != null)
tokenCounter.SetActive(true);