public void OnPointerDown(PointerEventData eventData) { if (canLaunchShip) { FadeToBlack.LoadScene(sceneName); } }
void Awake() { lev_con = FindObjectOfType <LevelController>(); fade = FindObjectOfType <FadeToBlack>(); switch (lev_con.current_level) { case 1: current_rooms = level_1_rooms; break; case 2: current_rooms = level_2_rooms; break; case 3: current_rooms = level_3_rooms; break; case 4: FindObjectOfType <MusicController>().PlayBossLaugh(); current_rooms = boss_rooms; break; } SpawnRooms(); }
public void OnClick() { GameObject transitionobject = Instantiate(Transition); FadeToBlack fadecontroller = transitionobject.GetComponent <FadeToBlack>(); fadecontroller.Next_Scene = First_Scene; }
/// <summary> /// Reset the fade delay and grab the fader /// </summary> /// <param name="ai">The AI executing this action</param> public override void Start(AI ai) { base.Start(ai); fader = ai.Body.GetComponentInChildren<FadeToBlack>(); fadeDelay = 5f; }
void Awake() { audioController = GameObject.Find("AudioController").GetComponent <AudioController>(); spriteRenderer = GetComponent <SpriteRenderer>(); rb = GetComponent <Rigidbody2D>(); fadeToBlack = GetComponent <FadeToBlack>(); }
void Start() { game_ = GameObject.FindGameObjectWithTag("GameController").GetComponent <Game>(); player_ = GameObject.FindGameObjectWithTag("Player").GetComponent <Player>(); animator_ = GetComponent <Animator>(); fadeToBlack_ = GameObject.FindGameObjectWithTag("FadeToBlack").GetComponent <FadeToBlack>(); cantFinishReasonText_ = GameObject.FindGameObjectWithTag("CantFinishTextUI").GetComponent <CantFinishReasonText>(); }
public static FadeToBlack Instance() { if (instance == null) { instance = GameObject.FindObjectOfType <FadeToBlack>(); } return(instance); }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } }
private void Start() { _fader = this.GetComponent <FadeToBlack>(); if (_fader == null) { Debug.LogError(this.gameObject.name + " is missing its FadeToBlack component for fading the screen to black"); } _audioPlayer = this.GetComponent <AudioSource>(); if (_audioPlayer == null) { Debug.LogError(this.gameObject.name + " is missing its AudioSource for playing the main music"); } }
// Start is called before the first frame update void Awake() { if (!player) { player = FindObjectOfType <Player>(); } if (!camera) { camera = Camera.main; } if (!fadeToBlack) { fadeToBlack = GetComponent <FadeToBlack>(); } }
private System.Threading.Tasks.Task FadeToBlackAsync() { CallFadeOut.Visibility = Visibility.Visible; var tcs = new System.Threading.Tasks.TaskCompletionSource <object>(); EventHandler <object> completed = null; completed = (o, e) => { FadeToBlack.Completed -= completed; tcs.SetResult(null); }; FadeToBlack.Completed += completed; FadeToBlack.Begin(); return(tcs.Task); }
// Update is called once per frame void Update() { if (Input.GetKeyDown(Glob.RightButton)) { GameInitializer.HardModeEnabled = true; FadeToBlack.DoFade(1, true, 1); //Application.LoadLevel(1); } else if (Input.GetKeyDown(Glob.LeftButton)) { GameInitializer.HardModeEnabled = false; FadeToBlack.DoFade(1, true, 1); //Application.LoadLevel(1); } }
private void StartInterstitial(int level) { GameObject g = null; // Debug.Log(level); switch (level) { case 1: // gameObject.GetComponent<AudioSource>().Stop(); g = Resources.Load("Interstitials/Tutorial", typeof(GameObject)) as GameObject; break; case 2: g = Resources.Load("Interstitials/Denial", typeof(GameObject)) as GameObject; break; case 3: g = Resources.Load("Interstitials/Anger", typeof(GameObject)) as GameObject; break; case 4: g = Resources.Load("Interstitials/Bargaining", typeof(GameObject)) as GameObject; break; case 5: g = Resources.Load("Interstitials/Depression", typeof(GameObject)) as GameObject; break; case 6: // g = Resources.Load("Interstitials/Acceptance", typeof(GameObject)) as GameObject; break; default: Debug.Log("The interstitial loader has failed to load the proper level"); break; } if (g != null) { GameObject interstitial = Instantiate(g) as GameObject; popupOpen = true; } else { FadeToBlack.Instance().FadeOut(); } }
void Awake() { game_ = GameObject.FindGameObjectWithTag("GameController").GetComponent <Game>(); fadeToBlack_ = GameObject.FindGameObjectWithTag("FadeToBlack").GetComponent <FadeToBlack>(); reminder_ = GameObject.FindGameObjectWithTag("Reminder"); reminder_.SetActive(false); direction_ = Direction.kRight; rigidBody_ = GetComponent <Rigidbody2D>(); typeWriter_ = GetComponent <TypeWriter>(); lockedOn_ = null; alive_ = true; isCarrying = false; wobbleTimer_ = 0.0f; prevGrounded_ = false; baseHingePosition_ = 0.0f; audioSources_ = GetComponents <AudioSource>(); }
void Start() { typeWriter_ = GetComponent <TypeWriter>(); typeWriter_.RegisterWord("start", WordListener); typeWriter_.RegisterWord("select", WordListener); typeWriter_.RegisterWord("menu", WordListener); typeWriter_.RegisterWord("tutorial1", WordListener); typeWriter_.RegisterWord("tutorial2", WordListener); typeWriter_.RegisterWord("tutorial3", WordListener); typeWriter_.RegisterWord("tutorial4", WordListener); typeWriter_.RegisterWord("tutorial5", WordListener); typeWriter_.RegisterWord("tutorial6", WordListener); typeWriter_.RegisterWord("level1", WordListener); typeWriter_.RegisterWord("level2", WordListener); typeWriter_.RegisterWord("level3", WordListener); fadeToBlack_ = GameObject.FindGameObjectWithTag("FadeToBlack").GetComponent <FadeToBlack>(); }
// Use this for initialization void Start() { startTime = Time.time; PlayerPrefs.SetString(PlayerPrefKeys.LAST_LEVEL, UnityEngine.SceneManagement.SceneManager.GetActiveScene().name); player = FindObjectOfType <Drive>(); snaps = new List <SnapShot>(); FadeToBlack ftb = FindObjectOfType <FadeToBlack>(); if (ftb) { ftb.UnFade(); } if (checkPoints > TagManager.CHECKPOINTS.Length) { Debug.LogError("You are trying to use more checkpoints than created, please create more checkpoint objects and tags"); } checkpointsCrossed = new bool[checkPoints]; checkpointObjects = new GameObject[checkPoints]; for (int index = 0; index < checkPoints; ++index) { checkpointsCrossed[index] = false; checkpointObjects[index] = GameObject.FindGameObjectWithTag(TagManager.CHECKPOINTS[index]); } stars = new GameObject[TagManager.STARS.Length]; for (int index = 0; index < stars.Length; ++index) { stars[index] = GameObject.FindGameObjectWithTag(TagManager.STARS[index]); } GameObject[] mushHaveInViewObjects = new GameObject[mustHaveInViewCheckpoints]; for (int index = 0; index < mustHaveInViewCheckpoints; ++index) { mushHaveInViewObjects[index] = checkpointObjects[index]; } cameraControl.mustHaveInView = mushHaveInViewObjects; }
private IEnumerator ReadDialog() { yield return(null); FadeToBlack.LoadScene(sceneName); }
// Start is called before the first frame update void Start() { gsm = FindObjectOfType <GameStatusManager>(); ftb = FindObjectOfType <FadeToBlack>(); clockImage = GameObject.Find("ClockImage").GetComponent <Image>(); }
// Start is called before the first frame update void Start() { player = GameObject.Find("Player").GetComponent <Player>(); ftb = GameObject.Find("FadeToBlack").GetComponent <FadeToBlack>(); }
private void Awake() { Instance = this; }
public static void ResetGame() { FadeToBlack.DoFade(1, true, 0); }
private void Awake() { ftb = FindObjectOfType <FadeToBlack>(); }
private void Start() { singleton = this; image.enabled = false; }
void Awake() { fade = FindObjectOfType <FadeToBlack>(); }
void Awake() { Instance = this; }
private void Awake() { Instance = this; canvasGroup = GetComponent <CanvasGroup> (); }
private void LoadScene() { FadeToBlack.LoadScene(sceneName); }
private void OnEnable() { FadeToBlack.LoadScene(sceneName); }
public void LoadScene() { FadeToBlack.LoadScene(sceneName); }