void UpdateRedpoint(RedPointState state, int count) { if (m_Simple != null) { m_Simple.gameObject.SetActive(state == RedPointState.Simple); } if (m_Count != null) { m_Count.gameObject.SetActive(state == RedPointState.Count); } if (m_CountText != null) { m_CountText.gameObject.SetActive(state == RedPointState.Count); if (state == RedPointState.Count) { m_CountText.SetText(count > 9 ? "N" : count >= 1 ? count.ToString() : ""); } } if (m_Full != null) { m_Full.gameObject.SetActive(state == RedPointState.Full); } }
public void SetRedPointState(int id, RedPointState state, int count) { if (!redpoints.ContainsKey(id)) { return; } var redpoint = redpoints[id]; redpoint.SetState(state, count); var parentId = redpoint.parent; if (parentId > 0) { UpdateParentValue(parentId); } }
public void SetState(RedPointState state, int count = 0) { this.state.value = state; this.count.value = count; }