void OnTriggerEnter(Collider collider) { // allowed target enters the trigger if (collider.tag.Equals("Mario")) { // get the target and its ITeleportable script target = collider.transform; teleportable = (ITeleportable)target.GetComponent(typeof(ITeleportable)); // checks if teleportable isn't valid if (teleportable == null) { target = null; return; } // set intial status teleportable.setOnTeleportPlace(true); teleportable.setDirEntrance(getDirEntrance()); // if the player was teleporting then start the fade out transition if (teleportable.isTeleporting()) { fader.startFading(EnumFadeDirection.FADE_OUT); } } }
private void optionSelected() { if (showOptions) { return; } PauseGameManager.Instance.pause(); fader.startFading(EnumFadeDirection.FADE_IN); showOptions = true; }
private void reloadLevel() { // reset and re spawn every actor status ReloadableManager.Instance.reloadActors(); // setup the scene components for the current scene setupSceneActors(); // start camera fade out IFadeable fader = Camera.main.GetComponent <CameraFadeable>().getFader(); fader.startFading(EnumFadeDirection.FADE_OUT); }