/// <summary> /// function to remove Cell Path Content /// </summary> public bool RemoveCellPathContent(CellPathContentAbstract value) { if (_useAdvancedArea == false) { Debug.LogWarningFormat("You trying to remove CellPathContentAbstract from AreaWorldMod when it's not setted up for advanced area. Position {0}", transform.position); } bool result; //remove from existing cells lock (cellPathContents) { result = cellPathContents.Remove(value); if (_useAdvancedArea) { lock (advancedArea.cells) { foreach (var cell in advancedArea.cells) { cell.RemovePathContent(value); } } } } return(result); }
/// <summary> /// function to add Cell Path Content /// </summary> public void AddCellPathContent(CellPathContentAbstract value) { if (_useAdvancedArea == false) { Debug.LogWarningFormat("You trying to add CellPathContentAbstract to AreaWorldMod when it's not setted up for advanced area. Position {0}", transform.position); } //add to existing cells lock (cellPathContents) { cellPathContents.Add(value); if (_useAdvancedArea) { lock (advancedArea.cells) { foreach (var cell in advancedArea.cells) { cell.AddPathContent(value); } } } } }