public static void EnableHPBar(GameObject go)
    {
        UObject.Destroy(go.GetComponent <DisableHPBar>());
        HealthManager hm = go.GetComponent <HealthManager>();

        hm.enabled = false;
        hm.enabled = true;
    }
Beispiel #2
0
        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);
            }
        }
Beispiel #3
0
 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>();
 }