public void Remove(MonoBehaviourProperty property, MonoBehaviourPropertyValueWithLocation valueWithLocation) { var value = valueWithLocation.Value.Value; if (value != null) { myUniquePropertyValues.Remove(property, new MonoBehaviorPropertyValueBox(valueWithLocation)); // file changes index var query = new MonoBehaviourPropertyWithFile(property, valueWithLocation.File); var beforeRemoveDifferentValuesCount = myValueCountPerPropertyAndFile.GetOrEmpty(query).Count; myValueCountPerPropertyAndFile.Remove(query, value); var afterRemoveDifferentValuesCount = myValueCountPerPropertyAndFile.GetOrEmpty(query).Count; if (beforeRemoveDifferentValuesCount == 2 && afterRemoveDifferentValuesCount == 1) { myValuesWhichAreUniqueInWholeFile.Add(new MonoBehaviourPropertyWithValue(property, myValueCountPerPropertyAndFile.GetOrEmpty(query).First().Key)); } else if (beforeRemoveDifferentValuesCount == 1 && afterRemoveDifferentValuesCount == 0) { myValuesWhichAreUniqueInWholeFile.Remove(new MonoBehaviourPropertyWithValue(property, value)); } myPropertyFiles.Remove(property, valueWithLocation.File); } myPropertyValues.Remove(property, valueWithLocation); }
public MonoBehaviorPropertyValueBox(MonoBehaviourPropertyValueWithLocation boxedValue) { BoxedValue = boxedValue; myHashObj = BoxedValue.Value.Value; }
protected bool Equals(MonoBehaviourPropertyValueWithLocation other) { return(Equals(File, other.File) && Value.Equals(other.Value)); }