public void UpdateContent() { SetGrid(); if (LeftButtonSkill.player == null) { LeftButtonSkill.SetPlayer(player); } if (RightButtonSkill.player == null) { RightButtonSkill.SetPlayer(player); } if (player.OnLeftClickSkill != null) { LeftButtonSkill.Set(player.OnLeftClickSkill, false); LeftButtonSkill.transform.localPosition = new Vector3(LeftButtonSkill.transform.localPosition.x, LeftButtonSkill.transform.localPosition.y, 0); } if (player.OnRightClickSkill != null) { RightButtonSkill.Show(); RightButtonSkill.Set(player.OnRightClickSkill, false); RightButtonSkill.transform.localPosition = new Vector3(RightButtonSkill.transform.localPosition.x, RightButtonSkill.transform.localPosition.y, 0); } }
public void RemoveSkill(object x) { SkillButton skillButton = (SkillButton)x; if (skillButton == LeftButtonSkill) { player.OnLeftClickSkill = null; } if (skillButton == RightButtonSkill) { player.OnRightClickSkill = null; player.ActiveSkill = null; } skillButton.Remove(); skillButton.Show(); }