Inheritance: MonoBehaviour, IFade
        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);
            }
        }
示例#2
0
    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)));
    }
示例#3
0
 private void WrapUpJob(int index)
 {
     FadeUI.FadeScreen(() =>
     {
         levelManager.CleanLevel();
         mainMenuUI.SetWindow(MainMenuUI.WINDOW.JOBS);
         _jobEntryUIElements[index].gameObject.SetActive(false);
     }, null, "Job Finished!");
 }
示例#4
0
        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;
            }
        }
示例#5
0
    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)));
    }
示例#6
0
 private void LoadLevel(int index)
 {
     FadeUI.FadeScreen(() =>
     {
         levelManager.LoadLevelAtIndex(index);
         mainMenuUI.SetWindow(MainMenuUI.WINDOW.NONE);
     }, () =>
     {
         FindObjectOfType <HandController>().Follow = true;
     }, "En Route!!!");
 }
示例#7
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
示例#8
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
示例#9
0
    private static IEnumerator FadePhase()
    {
        while (TopDownCamera.IsLearping)
        {
            yield return(null);
        }

        FadeUI fU = instance.pannelFaders[(int)UIPannels.Phase];

        yield return(fU.DoFade());

        SetActionPanel(true);
    }
示例#10
0
    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);
        }
    }
示例#12
0
    // 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);
            }
        }
示例#14
0
    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>();
        }
    }
示例#15
0
    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);
    }
示例#16
0
    //終了時に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);
    }
示例#17
0
    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)));
        }
    }
示例#18
0
    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);
    }
示例#19
0
 void Start()
 {
     instance  = this;
     img.color = new Color(img.color.r, img.color.g, img.color.b, 0f);
     DontDestroyOnLoad(gameObject);
 }
示例#20
0
    public static void FadePhanel(int panel)
    {
        FadeUI fU = instance.pannelFaders[panel];

        fU.Fade();
    }
示例#21
0
 // Start is called before the first frame update
 void Start()
 {
     _ui = GetComponent <FadeUI>();
 }
示例#22
0
文件: ShowCard.cs 项目: GouGit/stac
    protected void LowerCost()
    {
        FadeUI ui = board.transform.GetChild(2).GetComponent <FadeUI>();

        ui.FadeOut(0.5f, new Color(0, 0, 0, 1));
    }
示例#23
0
    //Unity Functions
    //====================================================================================================================//

    private void Awake()
    {
        _instance = this;
    }
示例#24
0
 // Start is called before the first frame update
 void Start()
 {
     _canvasGroup = transform.root.GetComponent <CanvasGroup>();
     _fade        = transform.root.GetComponent <FadeUI>();
 }