public void RemoveComponent(StarredComponent c) { if (Components.Remove(c)) { c.OnRemove(); } }
// #region COMPONENT public void AddComponent(StarredComponent c) { if (GetComponent(c.GetType().Name) == null) { Components.Add(c); c.OnAdd(); } else { Debug.Log("添加主角组件失败:" + c.GetType().Name); } }