public void OnSetButtonClick(object x) { // Debug.Log(skill1 == null); // Debug.Log("Co to za noher"+skill1.Hiden); if (skill != null) { SkillButton button = (SkillButton)x; //Debug.Log("Pizdec " + (skill == button)); //Debug.Log(button.skill.skillType); if (button == RightButtonSkill) { button.Set(skill.skill, false); player.OnRightClickSkill = button.skill; player.ActiveSkill = button.skill; } else if (button == LeftButtonSkill) { button.Set(skill.skill, false); player.OnLeftClickSkill = button.skill; } else { button.Set(skill.skill, false); } skillBar.OffGreen(); RightButtonSkill.OffGreen(); LeftButtonSkill.OffGreen(); skill.OffGreen(); // skill1 = null; skill = null; Debug.Log("Da blyat"); // DeactivateMoving = false; // skill1.OffGreen(); // skill1 = null; } }
public void SetGrid() { Debug.Log("HI"); DestroyGrid(); foreach (var item in player.Skills) { Debug.Log("HI"); SkillButton button = Instantiate(perhub); button.SetPlayer(player); button.Set(item, false); button.transform.SetParent(grid.transform, false); button.transform.localPosition = new Vector3(button.transform.localPosition.x, button.transform.localPosition.y, 0); button.OnClick += OnSkillClick; //Debug.LogWarning(button.transform.position.z); skills.Add(button); } }
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); } }