コード例 #1
0
ファイル: NPEntity.cs プロジェクト: ntahppsng/birds-game
 protected virtual void OnMouseDown()
 {
     Instantiate(deathAnimation, gameObject.transform.position, Quaternion.identity);
     Destroy(gameObject);
     pointsChanged.Invoke(PointsPerNPEntity);
     bonusBarStageChanged.Invoke(StagesPerNPEntity);
 }
コード例 #2
0
        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);
        }
コード例 #3
0
 public List <ImagePoint> GetPoints()
 {
     if (ans == null)
     {
         ans = GetPointsInternal();
         PointsChanged?.Invoke(ans);
     }
     return(ans);
 }
コード例 #4
0
ファイル: GameManager.cs プロジェクト: gpiffaretti/ovrcooked
    private void AddPoints(int points)
    {
        var result = this.points + points;

        if (result < 0)
        {
            this.points = 0;
        }
        else
        {
            this.points = result;
        }

        PointsChanged?.Invoke(this.points);
    }
コード例 #5
0
ファイル: Game.cs プロジェクト: JBoerrigter/Snake
        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;
        }
コード例 #6
0
 void OnMouseDown()
 {
     Destroy(gameObject);
     pointsChanged.Invoke(PointsPerBonusObject);
 }
コード例 #7
0
ファイル: EventManager.cs プロジェクト: R0bel/GameJam_Fork
 public void OnPointsChanged(int _points)
 {
     PointsChanged?.Invoke(_points);
 }
コード例 #8
0
 public void InvokePointsChanged()
 {
     PointsChanged?.Invoke(this, null);
 }
コード例 #9
0
 void OnMouseDown()
 {
     pointsChanged.Invoke(PointsPerMissClick);
     bonusBarRestarted.Invoke();
 }
コード例 #10
0
 // Destroy objects outside of the screen
 void OnBecameInvisible()
 {
     Destroy(gameObject);
     pointsChanged.Invoke(-1);
 }