コード例 #1
0
 public void RaiseLevelCompleted()
 {
     if (!GameObjects.GetGameState().LevelEditor)
     {
         LevelCompleted.Invoke();
     }
 }
コード例 #2
0
 void OnTriggerEnter2D(Collider2D col)
 {
     if (col.CompareTag("Player"))
     {
         LevelCompleted?.Invoke();
     }
 }
コード例 #3
0
    /// <summary>
    /// Triggers the Game Over State
    /// </summary>
    private void TriggerLevelComplete()
    {
        //Set it to be nobody's turn
        CurrentTurn = GameTurn.TURN_NONE;

        //Send Level Failed Event
        LevelCompleted?.Invoke();
    }
コード例 #4
0
 public bool CheckLevelCompleted()
 {
     if (objectivesFilled.AllFilled())
     {
         LevelCompleted.Invoke();
         return(true);
     }
     return(false);
 }
コード例 #5
0
ファイル: SoundPlayer.cs プロジェクト: peturhelgi/gamelab
        public void LoadSongs()
        {
            MenuSong   = _content.Load <Song>(SoundPath + "menu");
            IngameSong = _content.Load <Song>(SoundPath + "ingame");
            StorySong  = _content.Load <Song>(SoundPath + "story_song");

            GameOver       = _content.Load <SoundEffect>(SoundPath + "game_over");
            LevelCompleted = _content.Load <SoundEffect>(SoundPath + "level_completed");

            Pickaxe      = _content.Load <SoundEffect>(SoundPath + "pickaxe");
            PickKey      = _content.Load <SoundEffect>(SoundPath + "pick_key");
            InteractDoor = _content.Load <SoundEffect>(SoundPath + "interact_door");
            Dying        = _content.Load <SoundEffect>(SoundPath + "dying");

            gameOverInstance       = GameOver.CreateInstance();
            levelCompletedInstance = LevelCompleted.CreateInstance();
        }
コード例 #6
0
ファイル: Player.cs プロジェクト: icekovic/2D_platformer
    void Start()
    {
        player      = GameObject.FindWithTag("Player");
        facingRight = true;

        soundManager        = FindObjectOfType <SoundManager>();
        levelTransition     = FindObjectOfType <LevelTransition>();
        levelCompleted      = FindObjectOfType <LevelCompleted>();
        gameCompleted       = FindObjectOfType <GameCompleted>();
        gameOver            = FindObjectOfType <GameOver>();
        playerDied          = FindObjectOfType <PlayerDied>();
        collectiblesManager = FindObjectOfType <CollectiblesManager>();
        lifeManager         = FindObjectOfType <LifeManager>();
        saveData            = FindObjectOfType <SaveData>();

        rigidBody = GetComponent <Rigidbody2D>();
        animator  = GetComponent <Animator>();
    }
コード例 #7
0
 public static void CallLevelCompleted()
 {
     LevelCompleted?.Invoke();
 }
コード例 #8
0
 /// <summary>
 /// Trigger actions to end the current game with a success state
 /// </summary>
 private void TriggerLevelComplete()
 {
     LevelCompleted?.Invoke();
     gameRunning = false;
 }
コード例 #9
0
 /// <summary>
 /// Trigger actions to end the current game with a success state
 /// </summary>
 private void TriggerLevelComplete()
 {
     LevelCompleted?.Invoke();
 }
コード例 #10
0
 /// <summary>
 /// Trigger that the level has failed
 /// </summary>
 public void TriggerLevelFailed()
 {
     LevelCompleted?.Invoke();
 }
コード例 #11
0
 public static void TriggerLevelComplete() => LevelCompleted?.Invoke();