public override void _Ready() { instance = this; nameLabel = GetNode <Label>(NameLabelPath); hpLabel = GetNode <Label>(HpLabelPath); hpBar = GetNode <ColorRect>(HpFillPath); hpBar.RectSize = new Vector2((float)hpSizeMax, 10f); }
public static void ShowMobHUD(Mob mob) { if (instance.currentMobHud != null) { HideMobHUD(); } PackedScene mhps = ResourceLoader.Load(instance.MobHudResourcePath) as PackedScene; MobHUD mobHud = mhps.Instance() as MobHUD; instance.currentMobHud = mobHud; instance.AddChild(mobHud); mobHud.SetHudData(mob); GUIQueue.Add(GUIS.MobHud); }