//초기화 설정할 것들이 있다면 이곳에 추가하자. public void Init() { //오브젝트에 CameraFadeInOut 컴포넌트가 없다면 추가해준 뒤 변수에 할당한다. if (fadeInOutCtrl == null) { fadeInOutCtrl = GetComponent <CameraFadeInOut>(); if (fadeInOutCtrl == null) { fadeInOutCtrl = this.gameObject.AddComponent <CameraFadeInOut>(); } } LoadPagePrefeb = (GameObject)Resources.Load("LoadPage/Prefeb/LoadPageCanvas"); LoadPage = (GameObject)Instantiate(LoadPagePrefeb); LoadPage.name = "LoadPage"; LoadPage.SetActive(false); DontDestroyOnLoad(LoadPage); LoadPageBg = LoadPage.transform.FindChild("LoadImage").GetComponent <Image>(); LoadPageBg.sprite = Resources.Load <Sprite>("LoadPage/Image/LoadPageBg"); LoadPageProgressImgBg = LoadPage.transform.FindChild("LoadBarBg").GetComponent <Image>(); LoadPageProgressImgBg.sprite = Resources.Load <Sprite>("LoadPage/Image/LoadBarBg"); LoadPageProgressImgBg.color = new Color(LoadPageProgressImgBg.color.r, LoadPageProgressImgBg.color.g, LoadPageProgressImgBg.color.b, 0.3f); LoadPageProgressImgBg.type = Image.Type.Filled; LoadPageProgressImg = LoadPage.transform.FindChild("LoadBar").GetComponent <Image>(); LoadPageProgressImg.sprite = Resources.Load <Sprite>("LoadPage/Image/LoadBar"); LoadPageProgressImg.type = Image.Type.Filled; LoadPageProgressImg.fillMethod = Image.FillMethod.Horizontal; LoadPageProgressImg.fillOrigin = (int)Image.OriginHorizontal.Left; LoadPageProgressImg.fillAmount = 0.0f; }
// initiate a fade from the current screen color (set using "SetScreenOverlayColor") towards "newScreenOverlayColor" taking "fadeDuration" seconds public static CameraFadeInOut StartFadeInOut(float fadeDuration, Color newScreenOverlayColor) { if (Instance == null) { GameObject go = new GameObject("FadeInOut"); Instance = go.AddComponent <CameraFadeInOut> (); } Instance.StartFade(newScreenOverlayColor, fadeDuration / 3.0f); return(Instance); }
public static CameraFadeInOut StartFadeIn(float fadeDuration, Color fadeOutColor) { if (Instance == null) { GameObject go = new GameObject("FadeInOut"); Instance = go.AddComponent <CameraFadeInOut> (); } Instance.StartFade(fadeOutColor, fadeDuration / 2.0f); Instance.isFadeInFinish = true; Instance.fadeInOutLockTimer = 9999999f; Instance.targetScreenOverlayColor.a = -0.1f; return(Instance); }
protected override void Init() { if (fadeInOutCtrl == null) { fadeInOutCtrl = GetComponent <CameraFadeInOut>(); if (fadeInOutCtrl == null) { fadeInOutCtrl = this.gameObject.AddComponent <CameraFadeInOut>(); } } Manager_UI.Instance.InitSceneUI(EGameScene.TITLE); Debug.Log("<color=lightblue> Manager Initialize => </color>" + this.name.ToString()); }
public static CameraFadeInOut StartFadeOut(float fadeDuration, Color fadeOutColor) { if (Instance == null) { GameObject go = new GameObject("FadeInOut"); Instance = go.AddComponent <CameraFadeInOut>(); } Instance.StartFade(fadeOutColor, fadeDuration / 3.0f); Instance.isFadeInFinish = true; Instance.targetScreenOverlayColor = fadeOutColor; Instance.targetScreenOverlayColor.a = 0f; Instance.currentScreenOverlayColor = fadeOutColor; Instance.currentScreenOverlayColor.a = 1f; Instance.SetScreenOverlayColor(fadeOutColor); Instance.m_DeltaColor = new Color(0, 0, 0, -1f); return(Instance); }