void Start() { charSlot = GetComponentInParent <CharSlot>(); entityColor = GetComponentInChildren <EntityColor>(); charAnimator = GetComponent <CharAnimator>(); type = tag; vidaAtual = vidaMax; SetupUIBar(); KillCount = 0; LastKillCount = 0; }
public override void _Ready() { instance = this; playBtn = GetTree().Root.FindNode("PlayBtn", true, false) as Button; playBtn.Disabled = true; Node parent = GetTree().Root.FindNode("CharContainer", true, false); if (parent != null) { for (int i = 0; i < Characters.Count; i++) { CharSlot newCharslot = s_charslot.Instance() as CharSlot; newCharslot.GetNode <Label>("NameLabel").Text = Characters[i].getName(); newCharslot.AssignAttr(Characters[i]); parent.AddChild(newCharslot, true); } } else { GD.PrintErr("Failed to find the character container ndoe when creating character list."); } }
public int getBodysIndex(int position) { CharSlot teste = bodys.Where(x => x.position == position).First(); return(Array.IndexOf(bodys, teste)); }