private void OnTriggerEnter2D(Collider2D collision) { // Exit: if collision was Not the Player or collision happend a 2nd time if (once || collision.gameObject.tag != "Player") { return; } once = true; // Flag for a one time event // Disable Trigger to only happend once GetComponent <Collider2D>().enabled = false; // Enable Barrier to Stop Player from backtracking StopCollider.GetComponent <Collider2D>().enabled = true; // Flips the Entire World so helicopter goes the other direction PlayerController._player.FlipWorld(Direction, NextRespawn, !Final); // Move Camera for Next Layer Camera2DFollow.Follow.plusOnX *= (!Final) ? -1 : 0; // Disable Coins on Prev Layer DisableCoins.SetActive(false); // Enable Coins on Future Layer if (EnableCoins) { EnableCoins.SetActive(true); } // Final Layer goes North to South, instead of East to West. So Movable axis is on 'Y' // instead of 'X' if (Final) { // Switch Axis PlayerController._player.AllAxis = true; // No Enemy Spawning on Final Layer PlayerController._player.SpawnEnemyObject.GetComponent <SpawnEnemy>().Active = false; } }
public static void Resume() { MessageSystemPlayingScene.EnableCollider(); StopCollider.IsCollision = false; MessageSystemPlayingScene.IsHit = false; MessageSystemGameBlock.StartAfterHit(); MessageSystemPlayingScene.Player.GetComponent <Animator>().speed = 1; StopCollider.RestoreConstraints(); StopCollider.PlayAnimation(); StopCollider.SetDefaultSortingLayer(); StopCollider.SetActiveImageButtons(false); panel.SetActive(false); }
// Use this for initialization private void Awake() { // Disable Barrier to allow Player to Pass through StopCollider.GetComponent <Collider2D>().enabled = false; }