lcy
2025-05-21 1dd8f9a62db9e134f7d1b1a7e88d9b33cbe2b17a
Main/System/Redpoint/Redpoint.cs
@@ -1,64 +1,68 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
    public class Redpoint
    {
        int m_Id = 0;
        public int id {
            get { return m_Id; }
            private set { m_Id = value; }
        }
        int m_Parent = 0;
        public int parent {
            get { return m_Parent; }
            private set { m_Parent = value; }
        }
        RedPointState m_State = RedPointState.None;
        public RedPointState state {
            get { return m_State; }
            set {
                if (m_State != value)
                {
                    m_State = value;
                    RedpointCenter.Instance.Report(this);
                }
            }
        }
        int m_Count = 0;
        public int count {
            get { return m_Count; }
            set {
                if (m_Count != value)
                {
                    m_Count = value;
                    RedpointCenter.Instance.ReportWithoutParent(this);
                }
            }
        }
        public Redpoint(int _id)
        {
            id = _id;
            RedpointCenter.Instance.Register(this);
        }
        public Redpoint(int _parent, int _id)
        {
            if (_parent <= 0)
            {
                Debug.Log("无效的父对象Id!");
                return;
            }
            parent = _parent;
            id = _id;
            RedpointCenter.Instance.Register(this);
        }
        public int RedpoindId { get; internal set; }
    }
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace vnxbqy.UI
{
    public class Redpoint
    {
        int m_Id = 0;
        public int id {
            get { return m_Id; }
            private set { m_Id = value; }
        }
        int m_Parent = 0;
        public int parent {
            get { return m_Parent; }
            private set { m_Parent = value; }
        }
        RedPointState m_State = RedPointState.None;
        public RedPointState state {
            get { return m_State; }
            set {
                if (m_State != value)
                {
                    m_State = value;
                    RedpointCenter.Instance.Report(this);
                }
            }
        }
        int m_Count = 0;
        public int count {
            get { return m_Count; }
            set {
                if (m_Count != value)
                {
                    m_Count = value;
                    RedpointCenter.Instance.ReportWithoutParent(this);
                }
            }
        }
        public Redpoint(int _id)
        {
            id = _id;
            RedpointCenter.Instance.Register(this);
        }
        public Redpoint(int _parent, int _id)
        {
            if (_parent <= 0)
            {
                Debug.Log("无效的父对象Id!");
                return;
            }
            parent = _parent;
            id = _id;
            RedpointCenter.Instance.Register(this);
        }
        public int RedpoindId { get; internal set; }
    }
}