/// <summary> /// Adds a <see cref="DetectableGameObject"/> to the settings. /// </summary> /// <param name="settingsList">List of <see cref="GameObjectSettings"/></param> /// <param name="obj"><see cref="DetectableGameObject"/> to add</param> /// <param name="detectorSpaceType"><see cref="DetectorSpaceType"/>, /// box (2D) or sphere (3D)</param> /// <returns>If <see cref="GameObjectSettings"/> were created for /// <see cref="DetectableGameObject"/></returns> public bool TryAddDetectableObject( List <GameObjectSettings> settingsList, DetectableGameObject obj, DetectorSpaceType detectorSpaceType) { if (!m_Tags.Contains(obj.Tag)) { settingsList.Add(new GameObjectSettings(obj, detectorSpaceType)); return(true); } Debug.LogWarning($"Tag '{obj.Tag}' already added, tags must be distinct."); return(false); }
/// <summary> /// Creates the <see cref="GameObjectSettings"/> instance. /// </summary> /// <param name="detectable"><see cref="DetectableGameObject"/> /// the <see cref="GameObjectSettings"/> apply to</param> public GameObjectSettings(DetectableGameObject detectable, DetectorSpaceType detectorSpaceType) { Detectable = detectable; m_DetectorSpaceType = detectorSpaceType; }