public CircularGravity() { forcePoints = new List <GameObject>(); constraintProperties = new ConstraintProperties(); specialEffect = new SpecialEffect(); pulseProperties = new PulseProperties(); triggerAreaFilter = new TriggerAreaFilter(); tagFilter = new TagFilter(); drawGravityProperties = new DrawGravityProperties(); }
//Applies where filters for alignment public IEnumerable <Rigidbody> AlignToForceFilter(ConstraintProperties _constraintProperties, IEnumerable <Rigidbody> list) { switch (_constraintProperties._gameobjectFilter._gameobjectFilterOptions) { case GameobjectFilter.GameObjectFilterOptions.Disabled: break; case GameobjectFilter.GameObjectFilterOptions.OnlyEffectListedGameobjects: list = list.Where(r => _constraintProperties._gameobjectFilter.GameobjectList.Contains <GameObject>(r.transform.gameObject)); break; case GameobjectFilter.GameObjectFilterOptions.DontEffectListedGameobjects: list = list.Where(r => !_constraintProperties._gameobjectFilter.GameobjectList.Contains <GameObject>(r.transform.gameObject)); break; default: break; } switch (_constraintProperties._tagFilter._tagFilterOptions) { case TagFilter.TagFilterOptions.Disabled: break; case TagFilter.TagFilterOptions.OnlyEffectListedTags: list = list.Where(r => _constraintProperties._tagFilter.TagsList.Contains <string>(r.transform.gameObject.tag)); break; case TagFilter.TagFilterOptions.DontEffectListedTags: list = list.Where(r => !_constraintProperties._tagFilter.TagsList.Contains <string>(r.transform.gameObject.tag)); break; default: break; } switch (_constraintProperties._layerFilter._layerFilterOptions) { case LayerFilter.LayerFilterOptions.Disabled: break; case LayerFilter.LayerFilterOptions.OnlyEffectListedLayers: list = list.Where(r => _constraintProperties._layerFilter.LayerList.Contains <string>(LayerMask.LayerToName(r.transform.gameObject.layer))); break; case LayerFilter.LayerFilterOptions.DontEffectListedLayers: list = list.Where(r => !_constraintProperties._layerFilter.LayerList.Contains <string>(LayerMask.LayerToName(r.transform.gameObject.layer))); break; default: break; } return(list); }
public CircularGravity() { _forceTypeProperties = new ForceTypeProperties(); _specialEffect = new SpecialEffect(); _gameobjectFilter = new GameobjectFilter(); _tagFilter = new TagFilter(); _layerFilter = new LayerFilter(); _triggerAreaFilter = new TriggerAreaFilter(); _constraintProperties = new ConstraintProperties(); _constraintProperties._gameobjectFilter = new GameobjectFilter(); _constraintProperties._tagFilter = new TagFilter(); _constraintProperties._layerFilter = new LayerFilter(); _drawGravityProperties = new DrawGravityProperties(); }