hch
3 天以前 9cbc08083fb2224dbc7994d901124074f6dc6a4f
Main/System/Redpoint/RedpointCenter.cs
@@ -22,6 +22,7 @@
        {
            redpoint.state = RedPointState.None;
        }
        RemoverOtherParent();
    }
    public void Register(Redpoint _redpoint)
@@ -50,7 +51,7 @@
        }
    }
    //额外添加父红点用
    //额外添加父红点用,会屏蔽重复添加,外层可直接重复调用
    public void AddParent(int _parentId, int _childId)
    {
        Redpoint child = null;
@@ -59,7 +60,11 @@
            Debug.LogErrorFormat("添加父子关系失败,子节点不存在:id->{0}", _childId);
            return;
        }
        if (child.otherParent > 0)
        {
            //不重复添加
            return;
        }
        child.otherParent = _parentId;
        List<int> children = null;
@@ -74,6 +79,23 @@
        }
    }
    public void RemoverOtherParent()
    {
        List<int> otherParents = new List<int>();
        foreach (var redpoint in redpoints.Values)
        {
            if (redpoint.otherParent > 0)
            {
                otherParents.Add(redpoint.otherParent);
            }
            redpoint.otherParent = 0;
        }
        foreach (var parentId in otherParents)
        {
            parentChildren.Remove(parentId);
        }
    }
    public void Report(Redpoint _redpoint)
    {
        if (redpointValueChangeEvent != null)