protected virtual void OnMouseDown() { Instantiate(deathAnimation, gameObject.transform.position, Quaternion.identity); Destroy(gameObject); pointsChanged.Invoke(PointsPerNPEntity); bonusBarStageChanged.Invoke(StagesPerNPEntity); }
public bool TryUsePoints(float pointCount, bool strict) { if (_currentActionPoints > 0f && (!strict || _currentActionPoints >= pointCount)) { _currentActionPoints -= pointCount; if (PointsChanged != null) { PointsChanged.Invoke(); } if (_currentActionPoints <= 0f) { if (AutoEndTurn) { EndTurn(); } return(false); } return(true); } Debug.LogFormat("Not enough points: require {0} exists {1}", pointCount, _currentActionPoints); return(false); }
public List <ImagePoint> GetPoints() { if (ans == null) { ans = GetPointsInternal(); PointsChanged?.Invoke(ans); } return(ans); }
private void AddPoints(int points) { var result = this.points + points; if (result < 0) { this.points = 0; } else { this.points = result; } PointsChanged?.Invoke(this.points); }
private void GameTime_Tick(object sender, EventArgs e) { if (_snake.IsColliding(_playgroundBounds)) { _gameTime.Stop(); Gameover?.Invoke(this, EventArgs.Empty); return; } if (_snake.CanEat(_meal)) { _snake.Eat(_meal); CreateMeal(); SetDifficulty(); PointsChanged?.Invoke(this, EventArgs.Empty); } _snake.Move(_direction); Refresh(); _updated = false; }
void OnMouseDown() { Destroy(gameObject); pointsChanged.Invoke(PointsPerBonusObject); }
public void OnPointsChanged(int _points) { PointsChanged?.Invoke(_points); }
public void InvokePointsChanged() { PointsChanged?.Invoke(this, null); }
void OnMouseDown() { pointsChanged.Invoke(PointsPerMissClick); bonusBarRestarted.Invoke(); }
// Destroy objects outside of the screen void OnBecameInvisible() { Destroy(gameObject); pointsChanged.Invoke(-1); }