public void FadeGraphic(Graphic uiObject, bool status) { Coroutine coroutine, newCoroutine; if (status) { uiObject.enabled = true; newCoroutine = StartCoroutine(FadeUI.FadeTo(uiObject, 1, settings.uiFadeSpeed, null)); } else { newCoroutine = StartCoroutine(FadeUI.FadeTo(uiObject, 0, settings.uiFadeSpeed, () => { uiObject.enabled = false; })); }; if (fadeCoroutines.TryGetValue(uiObject, out coroutine)) { if (coroutine != null) { StopCoroutine(coroutine); } fadeCoroutines[uiObject] = newCoroutine; } else { fadeCoroutines.Add(uiObject, coroutine); } }
IEnumerator Transition(string sceneName, DestinationTag destinationTag) { FadeUI fadeUI = Instantiate(fadeCanvasPrefabs); SaveManager.Instance.SavePlayerData(); yield return(StartCoroutine(fadeUI.FadeOutScene(2f))); if (!SceneManager.GetActiveScene().name.Equals(sceneName)) { yield return(SceneManager.LoadSceneAsync(sceneName)); yield return(Instantiate(playerPrefabs, GetDestination(destinationTag).transform.position, GetDestination(destinationTag).transform.rotation)); SaveManager.Instance.LoadPlayerData(); } else { GameObject player = GameManager.Instance.playerStats.gameObject; player.GetComponent <NavMeshAgent>().enabled = false; player.transform.SetPositionAndRotation(GetDestination(destinationTag).transform.position, GetDestination(destinationTag).transform.rotation); player.GetComponent <NavMeshAgent>().enabled = true; } yield return(StartCoroutine(fadeUI.FadeInScene(2f))); }
private void WrapUpJob(int index) { FadeUI.FadeScreen(() => { levelManager.CleanLevel(); mainMenuUI.SetWindow(MainMenuUI.WINDOW.JOBS); _jobEntryUIElements[index].gameObject.SetActive(false); }, null, "Job Finished!"); }
private void CheckPath_Tick(object sender, EventArgs e) { // Überprüfe ob eine .csv datei gewählt wurde if (CsvProcessor.filePath != "" && File.Exists(CsvProcessor.filePath)) { // Datei gewählt! // Menüband anzeigen uploadButton.Visible = false; uploadButton.Enabled = false; saveButton.Enabled = true; saveButton.Visible = true; // datagridviewcontainer zeigen container.Enabled = true; container.Visible = true; } else { // Zeige nur den Lade Bildschirm uploadButton.Enabled = true; uploadButton.Visible = true; uploadButton.BackgroundImage = FadeUI.SetImageOpacity(Resources.Opened_Folder_48px, FadeUI.DoFadePictureBox()); FadeUI.DoFadeLabel(); label1.ForeColor = Color.FromArgb(FadeUI.DoFadeLabel()[0], FadeUI.DoFadeLabel()[1], FadeUI.DoFadeLabel()[2]); } // Ladeanimation schließen, sobald die Datei geladen wurde if (CsvProcessor.isDone == true) { loadingGif.Visible = false; loadingLabel.Visible = false; } // Chart Option verstecken, wenn 2 oder weniger Zeilen existieren if (workspaceDataGridView.Rows.Count > 2) { chartButton.Visible = true; } else { chartButton.Visible = false; } // Wenn Spalte hinzufügen Textbox nicht leer ist, submit button zeigen oder verstecken if (AddColumnHeaderText.Text != "") { hinzufügenToolStripMenuItem.Visible = true; } else { hinzufügenToolStripMenuItem.Visible = false; } }
private IEnumerator TransitionToStartScene() { FadeUI fadeUI = Instantiate(fadeCanvasPrefabs); yield return(StartCoroutine(fadeUI.FadeOutScene(2f))); yield return(SceneManager.LoadSceneAsync("StartScene")); PlayerPrefs.DeleteAll(); yield return(StartCoroutine(fadeUI.FadeInScene(2f))); }
private void LoadLevel(int index) { FadeUI.FadeScreen(() => { levelManager.LoadLevelAtIndex(index); mainMenuUI.SetWindow(MainMenuUI.WINDOW.NONE); }, () => { FindObjectOfType <HandController>().Follow = true; }, "En Route!!!"); }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(this.gameObject); } }
private void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
private static IEnumerator FadePhase() { while (TopDownCamera.IsLearping) { yield return(null); } FadeUI fU = instance.pannelFaders[(int)UIPannels.Phase]; yield return(fU.DoFade()); SetActionPanel(true); }
IEnumerator ch() { black.SetActive(true); FadeUI.FadeIn(black); yield return(new WaitForSeconds(0.2f)); toUnload.SetActive(false); toLoad.SetActive(true); FadeUI.FadeOut(black); yield return(new WaitForSeconds(0.2f)); black.SetActive(false); }
void AddFade(Transform t) { FadeUI scr = t.GetComponent <FadeUI>(); if (scr == null) { scr = t.gameObject.AddComponent <FadeUI>(); scr.delay = delay; scr.speed = speed; scr.child = true; scr.splashScreen = splashScreen; childFades.Add(scr); scr.StartFade(true); } }
// Start is called before the first frame update private void Start() { transform = gameObject.transform as RectTransform; _canvasRect = GetComponentInParent <Canvas>().transform as RectTransform; SetupUI(); SetWindow(WINDOW.NONE); FadeUI.FadeScreen(() => { SetWindow(WINDOW.MAIN); }, null); }
public void FadeCanvasGroup(CanvasGroup fadeCanvasGroup, float alpha, float speed, Action callback = null) { var newRoutine = StartCoroutine(FadeUI.FadeTo(fadeCanvasGroup, alpha, speed, callback)); Coroutine coroutine; if (fadeCoroutines.TryGetValue(fadeCanvasGroup, out coroutine)) { if (coroutine != null) { StopCoroutine(coroutine); } fadeCoroutines[fadeCanvasGroup] = newRoutine; } else { fadeCoroutines.Add(fadeCanvasGroup, newRoutine); } }
private void Start() { if (!smallTooltip) { smallTooltip = GameObject.Find("SmallTooltip"); rectTransform = smallTooltip.GetComponent <RectTransform>(); if (smallTooltip.activeInHierarchy) { smallTooltip.SetActive(false); } offset.x = rectTransform.rect.width / 2 + 5; offset.y = rectTransform.rect.height / 2 + 5; fadeUI = smallTooltip.GetComponent <FadeUI>(); tooltipText = smallTooltip.transform.Find("Text Tooltip").GetComponent <Text>(); } }
IEnumerator ch() { FadeUI.FadeIn(black); yield return(new WaitForSeconds(0.5f)); if (toUnload != "") { SceneManager.UnloadSceneAsync(toUnload); } yield return(new WaitForSeconds(delayTime + 1f)); FadeUI.FadeOut(black); if (toLoad != "") { SceneManager.LoadScene(toLoad, LoadSceneMode.Additive); } isChanging = false; yield return(new WaitForSeconds(0.4f)); black.SetActive(false); }
//終了時にtrueを返す public bool FadeIn(float timer) { if (initflag) { gobjFadeUI.SetActive(true); fade = gobjFadeUI.GetComponent <FadeUI>(); fade.Range = 0; initflag = false; return(false); } fade.Range += Time.deltaTime / timer; if (fade.Range >= 1) { //gobjFadeUI.SetActive(false); initflag = true; return(true); } return(false); }
private IEnumerator TransitionToGameScene(string sceneName) { FadeUI fadeUI = Instantiate(fadeCanvasPrefabs); if (sceneName != "") { yield return(StartCoroutine(fadeUI.FadeOutScene(2f))); yield return(SceneManager.LoadSceneAsync(sceneName)); foreach (var VARIABLE in FindObjectsOfType <TransitionDestination>()) { if (VARIABLE.destinationTag == DestinationTag.ENTER) { yield return(Instantiate(playerPrefabs, VARIABLE.transform.position, VARIABLE.transform.rotation)); break; } } yield return(StartCoroutine(fadeUI.FadeInScene(2f))); } }
bool initflag = true; //このフラグがONの時、FadeOut,FadeInは初期化を実行する //終了時にtrueを返す public bool FadeOut(float timer) { if (initflag) { gobjFadeUI.SetActive(true); fade = gobjFadeUI.GetComponent <FadeUI>(); fade.Range = 1; initflag = false; Debug.Log(fade.Range); return(false); } Debug.Log(timer); Debug.Log(fade.Range); fade.Range -= Time.deltaTime / timer; if (fade.Range <= 0) { initflag = true; return(true); } return(false); }
void Start() { instance = this; img.color = new Color(img.color.r, img.color.g, img.color.b, 0f); DontDestroyOnLoad(gameObject); }
public static void FadePhanel(int panel) { FadeUI fU = instance.pannelFaders[panel]; fU.Fade(); }
// Start is called before the first frame update void Start() { _ui = GetComponent <FadeUI>(); }
protected void LowerCost() { FadeUI ui = board.transform.GetChild(2).GetComponent <FadeUI>(); ui.FadeOut(0.5f, new Color(0, 0, 0, 1)); }
//Unity Functions //====================================================================================================================// private void Awake() { _instance = this; }
// Start is called before the first frame update void Start() { _canvasGroup = transform.root.GetComponent <CanvasGroup>(); _fade = transform.root.GetComponent <FadeUI>(); }