/// <summary> /// Remove all default Actors that doesn't exist in data /// </summary> private void ClearUnusedDefaultInputs(LiveFrame_v4 frame) { if (actors != null) { foreach (Actor actor in new List <Actor>((IEnumerable <Actor>)actors.Values)) { // Don't remove idle demo if (actor.profileName == ACTOR_DEMO_IDLE_NAME) { continue; } if (!frame.HasProfile(actor.profileName)) { actors.Remove(actor.profileName); } } } if (props != null) { foreach (Prop prop in new List <Prop>((IEnumerable <Prop>)props.Values)) { if (!frame.HasProp(prop.propName)) { props.Remove(prop.propName); } } } }
/// <summary> /// Remove all rows that no longer exists in live data /// </summary> private void ClearUnusedInputRows(LiveFrame_v4 frame) { foreach (InputHierarchyRow row in new List <InputHierarchyRow>((IEnumerable <InputHierarchyRow>)rows.Values)) { if (!frame.HasProfile(row.profileName) && !frame.HasProp(row.profileName)) { rows.Remove(row.profileName); } } }