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
+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>();