public void AddAlteration(IHasSpeed hasSpeed, ISpeedAlteration speedAlteration) { if (!MySpeedAlterationsDict.ContainsKey(hasSpeed)) { MySpeedAlterationsDict[hasSpeed] = new List <ISpeedAlteration>(); } MySpeedAlterationsDict[hasSpeed].Add(speedAlteration); }
public void RemoveAlteration(IHasSpeed hasSpeed, ISpeedAlteration speedAlteration) { if (!MySpeedAlterationsDict.ContainsKey(hasSpeed)) { Debug.LogError("Attempting to remove speed alteration from a HasSpeed that is not registered."); } MySpeedAlterationsDict[hasSpeed].Remove(speedAlteration); }