/// <summary> /// Fired upon GameObject creation. /// </summary> public void OnDestroy(GameObject obj) { if (obj != null && obj.IsValid) { if (WorkedGrounds.Any(o => o.Key == obj.NetworkId)) { WorkedGrounds.Remove(obj.NetworkId); } if (MineField.Any(o => o.Key == obj.NetworkId)) { MineField.Remove(obj.NetworkId); } } }
/// <summary> /// Fired upon GameObject creation. /// </summary> public void OnDelete(GameObjectDeleteEventArgs args) { var obj = args.Sender; if (obj.IsValid) { if (WorkedGrounds.Any(o => o.Key == obj)) { WorkedGrounds.Remove(obj); } if (MineField.Any(o => o.Key == obj)) { MineField.Remove(obj); } } }