private void OnMouseDown() { var selectedObject = prepareForBattleObjects[_selectedObjectIndex]; var mouseWorldPosition = MUtils.Mouse.GetWorldPosition(Camera.main); if (_grid.CanPutDownObject(selectedObject.objectData, mouseWorldPosition)) { _grid.PutDownObject(selectedObject.objectData, mouseWorldPosition, ShipCellState.Alive); selectedObject.amount--; if (IsReadyForBattle()) { Destroy(_selectedObjectRenderer); OnReadyForBattle?.Invoke(); } else if (selectedObject.amount == 0) { ToggleSelectedGridObject(); } } }
public void Activate() { gameObject.SetActive(true); OnReadyForBattle?.Invoke(); }