Beispiel #1
0
    /// <summary>
    /// 注册聚焦项
    /// </summary>
    public void Register(FocusableRoot root, FocusableItem item)
    {
        if (!this.Enable)
        {
            return;
        }
        var c = this.Containers.Find(container => container.Root == root);

        c.Items.Add(item);
        StartCoroutine(UpdateList());
    }
Beispiel #2
0
    /// <summary>
    /// 注销聚焦项
    /// </summary>
    public void UnRegister(FocusableRoot root, FocusableItem item)
    {
        if (!this.Enable)
        {
            return;
        }
        var c = this.Containers.Find(container => container.Root == root);

        if (c != null)
        {
            c.Items.Remove(item);
        }
        StartCoroutine(UpdateList());
    }
Beispiel #3
0
 /// <summary>
 /// 获取聚焦项根节点
 /// </summary>
 protected virtual void FindRoot()
 {
     this.Root = transform.GetComponentInParent <FocusableRoot>();
 }