void Start() { // 화이트 디졸브 animWhiteDissolve = whiteDissolve.GetComponent <Animator>(); whiteDissolveSound = whiteDissolve.GetComponent <AudioSource>(); // 카메라 백그라운드 컬러 mainCamBackScript = mainCam.GetComponent <ChangeBackColor>(); // 에덴 선악과 edenSpotlight = forbiddenFruit.GetComponent <Light>(); edenDirectlight = GameObject.Find("Directional Light for Eden").GetComponent <Light>(); audioDrugAddictLight = GameObject.Find("DrugAddictSpotlight").GetComponent <AudioSource>(); audioEden = GameObject.Find("EdenSoundPlayer").GetComponent <AudioSource>(); audioLivingGodScary = GetComponent <AudioSource>(); edenMoodLightControl = GameObject.Find("EdenMoodLight").GetComponent <EdenMoodLightController>(); // 선악과 아웃라인 끄기 outLineForTree = mainTreeOutline.GetComponent <Outline>(); treeGen0217 = mainTreeText.GetComponent <TextMeshPro>(); // 제목달기 god = GameObject.Find("God").GetComponent <TextFade>(); originalMan = GameObject.Find("OriginalMan").GetComponent <TextFade>(); originalProblem = GameObject.Find("OriginalProblem").GetComponent <TextFade>(); problemsOfMan = GameObject.Find("ProblemsOfMan").GetComponent <TextFade>(); // 성경구절 나무버튼과 함께 끄기 gen0128 = GameObject.Find("Gen0128").GetComponent <BibleVersusPopup>(); gen0315 = GameObject.Find("Gen0315").GetComponent <BibleVersusPopup>(); eph22 = GameObject.Find("Eph22").GetComponent <BibleVersusPopup>(); bibleClickManager = GameObject.Find("BibleVersus").GetComponent <BibleButtonClickManager>(); }
void CollectOre(OreType type, int amount) { if (amount == 0) { return; } currentOres[(int)type] += amount; backPack += amount; OnPackFillChanged?.Invoke(backPack, backPackCap); // +amount type (total) //Debug.Log($"Gained {type} ({currentOres[(int)type]})"); if (pickupTextQueue.Count < pickupQueueLength) { // create a new one TextFade copy = Instantiate(pickupTextPrefab); pickupTextQueue.Enqueue(copy); } TextFade next = pickupTextQueue.Dequeue(); next.transform.position = transform.position + pickupOffset; // negate when facing left next.UpdateColour(type); next.SetText($"+{amount} {type} ({currentOres[(int)type]})"); next.Reset(); pickupTextQueue.Enqueue(next); // recycle //pickupText.text = $"+{amount} {type} ({currentOres[(int)type]})"; OnOreChanged?.Invoke((int)type, currentOres[(int)type]); if (IsBagFull()) { BagFull(); } }
// Use this for initialization protected void Start() { base.Start(); if (stats == null) { stats = new Stats(this, 1); } renderer.sortingLayerName = "Creatures"; canvasTransform = ((GameObject)Instantiate(GameManager.Manager.canvasTemplate)).transform; canvasTransform.position = transform.position; canvasTransform.SetParent(transform); healthBar = Instantiate(GameManager.Manager.healthBar) as GameObject; healthBar.transform.position = transform.position + new Vector3(0, 0.7f, 0); healthBar.transform.SetParent(canvasTransform); Image[] bars = healthBar.GetComponentsInChildren <Image>(); barImage = bars[1]; healthSlider = healthBar.GetComponent <Slider>(); healthSlider.maxValue = stats.MaxHealth; GameObject damageDisplay = Instantiate(GameManager.Manager.damageIndicator) as GameObject; damageDisplay.transform.position = transform.position + new Vector3(0, 1, 0); damageDisplay.transform.SetParent(canvasTransform); damageIndicator = damageDisplay.GetComponent <TextFade>(); }
void Start() { CreateSpawns(); waveCountDown = secondsBetweenWaves; upgradeMenu = GameObject.FindGameObjectWithTag("UpgradeMenu").GetComponent <UpgradeMenu>(); upgradeMenu.CloseMenu(); fade = gameObject.GetComponent <TextFade>(); }
/// <summary> /// Hides our text item if it is displaying. /// </summary> public void Hide() { if (TextObject == null) { return; } TextFade.SetState(false); TextObject.SetActive(false); }
static bool PatchTextFade(TextFade __instance, ref float ___currentFPS, ref float ___OpacityStart, ref Color ___c) { ___currentFPS = 60f; ___c = __instance.gameObject.GetComponent <TextMesh>().color; ___c.a = ___OpacityStart; __instance.gameObject.GetComponent <TextMesh>().color = ___c; //Prevent original method from running after the prefix return(false); }
// Start is called before the first frame update void Start() { pickHit = GetComponent <AudioSource>(); spriteRenderer = GetComponent <SpriteRenderer>(); targetPos = transform.position; currentOres = new int[Enum.GetNames(typeof(OreType)).Length]; pickupTextQueue = new Queue <TextFade>(pickupQueueLength); TextFade copy = Instantiate(pickupTextPrefab); pickupTextQueue.Enqueue(copy); Ore.OnMined += CollectOre; }
/// <summary> /// 使一个文本淡出但不摧毁 /// </summary> /// <param name="target">物体</param> /// <param name="seconds">淡出经历时间【可选】</param> static public float HideText(GameObject target, float seconds = 0.5f) { // print("【Hide [" + target + "] in " + seconds + " seconds .】"); TextFade fo = target.GetComponent <TextFade>(); if (fo != null) { Destroy(fo); } TextFade f = target.AddComponent <TextFade>(); f.FadeOut(seconds); return(seconds); }
/// <summary> /// 使一个文本淡出并摧毁 /// </summary> /// <param name="target">物体</param> /// <param name="seconds">淡出经历时间【可选】</param> static public float FadeOutText(GameObject target, float seconds = 0.5f) { // print("【Hide [" + target + "] in " + seconds + " seconds .】"); TextFade fo = target.GetComponent <TextFade>(); if (fo != null) { Destroy(fo); } TextFade f = target.AddComponent <TextFade>(); f.FadeOut(seconds); mainCamera.StartCoroutine(DestroyDelayed(target, seconds + 0.1f)); return(seconds); }
/// <summary> /// 淡入淡出文本框 /// </summary> /// <param name="inS">淡入时间</param> /// <param name="outS">淡出时间</param> /// <returns></returns> static private IEnumerator FadeText(GameObject tOb, float seconds, float inS = 0.5f, float outS = 1.0f) { TextFade fade = tOb.AddComponent <TextFade>(); fade.FadeIn(inS); yield return(new WaitForSeconds(inS)); yield return(new WaitForSeconds(seconds - inS - outS > 0 ? seconds - inS - outS : 0)); TextFade fade2 = tOb.AddComponent <TextFade>(); fade2.FadeOut(outS); yield return(new WaitForSeconds(outS + 0.1f)); Destroy(tOb); yield return(0); }
/// <summary> /// Uses an alpha effect to fade text (Level 1, 2, 3, etc) in and out. /// </summary> /// <returns></returns> private IEnumerator FadeLevelTextInAndOut() { var text = PlayerUiScript.GetPlayerUiScript().GetLevelTooltip().GetComponent <TMP_Text>(); if (text == null) { yield break; } text.gameObject.SetActive(true); StartCoroutine(TextFade.FadeTextToFullAlpha(3f * Time.timeScale, text)); yield return(new WaitForSeconds(3f * Time.timeScale)); StartCoroutine(TextFade.FadeTextToZeroAlpha(2f * Time.timeScale, text)); yield return(new WaitForSeconds(2f * Time.timeScale)); text.gameObject.SetActive(false); }
/// <summary> /// Uses an alpha effect to fade text (Level 1, 2, 3, etc) in and out. /// </summary> /// <returns></returns> public static IEnumerator FadeTextInAndOut(string text, float fadeInTime = 3f, float fadeOutTime = 2f) { var textObject = PlayerUiScript.GetPlayerUiScript().GetLevelTooltip().GetComponent <TMP_Text>(); if (textObject == null) { yield break; } textObject.text = text; textObject.gameObject.SetActive(true); _instance.StartCoroutine(TextFade.FadeTextToFullAlpha(fadeInTime * Time.timeScale, textObject)); yield return(new WaitForSeconds(fadeInTime * Time.timeScale)); _instance.StartCoroutine(TextFade.FadeTextToZeroAlpha(fadeOutTime * Time.timeScale, textObject)); yield return(new WaitForSeconds(fadeOutTime * Time.timeScale)); textObject.gameObject.SetActive(false); }
/// <summary> /// Shows our text item, fading after a specified number of seconds (or stays on indefinitely if 0 seconds) /// </summary> /// <param name="s">The text to display</param> /// <param name="seconds">The duration to hold before fading</param> public void ShowMessage(string s, float seconds) { if (TextObject == null) { // First time only, initialize the object and components InitializeText(); } // Set our actual text TextFade.SetText(s); // Sets our location on the screen DoAlignment(); // Turns our text item on TextFade.SetState(true); TextObject.SetActive(true); // If specified, sets the fade-out timer if (seconds > 0) { TextFade.FadeOut(seconds, null); } }
void Start() { _FadeComponent = GetComponent <TextFade>(); }
void Start() { // 성경구절 불러오기 bibleClickManager = bibleVersus.GetComponent <BibleButtonClickManager>(); bibleClickManager.BibleState(0); bibleTurnOff = GameObject.FindGameObjectsWithTag("BibleTurnOff"); // 버튼들 모두 불러오기 allUIOnOff = GameObject.FindGameObjectsWithTag("ButtonOnOff"); // 버추어 카메라 POV 리셋 설정 cmPOVreset = GameObject.FindGameObjectsWithTag("VirtualCam"); // 카메라 시작 시점. 해와 달 마스크 mainCamera.cullingMask = (1 << cullingLayerDefault) | (1 << cullingLayerSunNMoon); audioSee = edenCam.GetComponent <AudioSource>(); audioEden = edenSound.GetComponent <AudioSource>(); audioIdol = idolCam.GetComponent <AudioSource>(); audioGameAddict = gameAddictCam.GetComponent <AudioSource>(); audioGameAddictLight = gameAddictSpotlight.GetComponent <AudioSource>(); audioDrugAddict = drugAddictCam.GetComponent <AudioSource>(); audioDrugAddictLight = drugAddictSpotlight.GetComponent <AudioSource>(); audioHospital = hosptialCam.GetComponent <AudioSource>(); audioHospitalLight = hospitalSpotlight.GetComponent <AudioSource>(); audioDead = deadCam.GetComponent <AudioSource>(); audioChrist = threeJobsCam.GetComponent <AudioSource>(); anim_EdenRotation = edenPivot.GetComponent <Animator>(); anim_EdenRotation.SetBool("Rotate", true); anim_CrossFade = cross.GetComponent <Animator>(); anim_CrossFade2 = cross2.GetComponent <Animator>(); anim_CrossFade.SetBool("Fade", false); anim_CrossFade2.SetBool("Fade", false); //영접기도문 켜고끄기 prayerPanelRaycast = GameObject.Find("PrayerPanel").GetComponent <CanvasGroup>(); gameAddictLight = gameAddictLight.GetComponent <Light>(); gameAddictLight.enabled = false; drugAddictLight = drugAddictLight.GetComponent <Light>(); drugAddictLight.enabled = false; hospitalLight = hospitalLight.GetComponent <Light>(); hospitalLight.enabled = false; edenSpotlight = GameObject.Find("Eden Spotlight").GetComponent <Light>(); idolLights.SetActive(false); deadLights.SetActive(false); christLights.SetActive(false); gameAddictLightS.SetActive(false); // 제목 셋팅 시작 god = GameObject.Find("God").GetComponent <TextFade>(); originalMan = GameObject.Find("OriginalMan").GetComponent <TextFade>(); originalMan.displayInfo = false; originalProblem = GameObject.Find("OriginalProblem").GetComponent <TextFade>(); originalProblem.displayInfo = false; problemsOfMan = GameObject.Find("ProblemsOfMan").GetComponent <TextFade>(); problemsOfMan.displayInfo = false; theWay = GameObject.Find("TheWay").GetComponent <TextFade>(); theWay.displayInfo = false; // 선악과 버튼 셋팅 buttonTree = mainTree.GetComponent <ButtonTree>(); outLineForTree = mainTreeOutline.GetComponent <Outline>(); // 선악과 텍스트 셋팅 treeGen0217 = treeText.GetComponent <TextMeshPro>(); // 선악과 콜라이더 on off forbiddenFruitsTree = mainTree.GetComponent <CapsuleCollider>(); // 십자가 아웃라인 셋팅 outLineForCross = CrossOutline.GetComponent <Outline>(); // 우상신전 연기 피우기 셋팅 smoke = whiteSmoke.GetComponent <ParticleSystem>(); smoke.Stop(true); // 페이지 시작 TurnSunNMoonOn(); }
private void Next() { if (m_Story.canContinue) { string text = m_Story.Continue().Trim(); Line nextLine = CreateContentView(text, m_ResponseIndex); m_ResponseIndex = -1; string back; string right; string left; // Check possible commands. if (GetTagValue("back", out back) && back != m_LastBack) { m_LastBack = back; m_Backdrop.DestroyAllChildren(); if (m_Assets.Backdrops.ContainsKey(back)) { Instantiate(m_Assets.Backdrops[back], m_Backdrop, false); } } if (GetTagValue("right", out right) && right != m_LastRight) { m_LastRight = right; m_OnStageRight.DestroyAllChildren(); if (m_Assets.Characters.ContainsKey(right)) { GameObject go = Instantiate(m_Assets.Characters[right], m_OnStageRight, false); go.transform.position = m_OffStageRight.position; go.transform.DOLocalMove(Vector3.zero, m_SlideDuration); } } if (GetTagValue("left", out left) && left != m_LastLeft) { m_LastLeft = left; m_OnStageLeft.DestroyAllChildren(); if (m_Assets.Characters.ContainsKey(left)) { GameObject go = Instantiate(m_Assets.Characters[left], m_OnStageLeft, false); go.transform.position = m_OffStageLeft.position; go.transform.DOLocalMove(Vector3.zero, m_SlideDuration); } } if (m_OnFirstLine) { m_OnFirstLine = false; Next(); return; } TextFade tf = nextLine.GetComponentInChildren <TextFade>(); if (tf) { tf.OnComplete.AddListener(Next); } else { DelayTracker.DelayAction(m_NextDelay, Next); } return; } if (m_Story.currentChoices.Count > 0) { // Fade old choices. GetComponentsInChildren <Line>().Where(l => l.LineType == Line.Type.Player).ForEach(l => l.FadeOut()); for (int i = 0; i < m_Story.currentChoices.Count; i++) { Choice choice = m_Story.currentChoices[i]; ChoiceLine button = CreateChoiceView(choice.text.Trim()); button.OnClick.AddListener(() => OnClickChoiceButton(button, choice)); } } else { ChoiceLine choice = CreateChoiceView("End of story.\nRestart?"); choice.OnClick.AddListener(StartStory); } }