Ejemplo n.º 1
0
 public void RemoveComponent(IComponent component)
 {
     if (ComponentDict.ContainsKey(component.ComponentType))
     {
         ComponentDict[component.ComponentType].Remove(component);
     }
     else
     {
         Debug.LogWarning($"在移除组件:{component.ComponentType}时遇到了预期外的错误");
     }
 }
Ejemplo n.º 2
0
 public void AddComponent(IComponent component)
 {
     Debug.Log("??");
     if (ComponentDict.ContainsKey(component.ComponentType))
     {
         ComponentDict[component.ComponentType].Add(component);
     }
     else
     {
         ComponentDict.Add(component.ComponentType, new List <IComponent> {
             component
         });
     }
 }