public static void EnableHPBar(GameObject go) { UObject.Destroy(go.GetComponent <DisableHPBar>()); HealthManager hm = go.GetComponent <HealthManager>(); hm.enabled = false; hm.enabled = true; }
public static void Destroy(UObject obj) { if (obj is Transform) { throw new ArgumentException("Unable to destroy Transform", nameof(obj)); } if (!obj) { return; } if (Application.isPlaying) { UObject.Destroy(obj); } else { UObject.DestroyImmediate(obj); } }
public void Destroy() { UObject.Destroy(GameObject); }
public static void DisableHPBar(GameObject go) { UObject.Destroy(go.GetComponent <HPBar>()); UObject.Destroy(go.GetComponent <BossHPBar>()); go.AddComponent <DisableHPBar>(); }