Exemplo n.º 1
0
    //public SkillButton skill1;
    void Start()
    {
        RightButtonSkill.SetPlayer(player);
        LeftButtonSkill.SetPlayer(player);
        RightButtonSkill.OnClick      += OnSetButtonClick;
        LeftButtonSkill.OnClick       += OnSetButtonClick;
        RightButtonSkill.OnRightClick += RemoveSkill;
        LeftButtonSkill.OnRightClick  += RemoveSkill;
        RightButtonSkill.Usable        = false;
        LeftButtonSkill.Usable         = false;
        foreach (var item in skillBar.buttons)
        {
            item.OnClick += OnSetButtonClick;

            //    Debug.Log(item.OnClick.Method.Name);
        }

        skills = new List <SkillButton>();
        RightButtonSkill.transform.localPosition = new Vector3(RightButtonSkill.transform.localPosition.x, RightButtonSkill.transform.localPosition.y, 0);
        LeftButtonSkill.transform.localPosition  = new Vector3(LeftButtonSkill.transform.localPosition.x, LeftButtonSkill.transform.localPosition.y, 0);
        player.OnSkillRemoved += (x) => { UpdateContent(); };
        player.OnSkillAdded   += (x) => { UpdateContent(); };
        if (player.Loaded)
        {
            UpdateContent();
        }
        else
        {
            player.OnLoaded += (x) => { UpdateContent(); };
        }
    }
Exemplo n.º 2
0
 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);
     }
 }