protected override void UpdateLoadingProgressBar() { if (TColor == null) { return; } float tAmount = 0f; float s1Amount = 0f; float s2Amount = 0f; if (Progress < 1 / 3f) { tAmount = Progress * 3f; } else if (Progress < 2 / 3f) { tAmount = 1f; s1Amount = Progress * 3f - 1f; } else { tAmount = 1f; s1Amount = 1f; s2Amount = Progress * 3f - 2f; } TColor.GetComponent <Image>().fillAmount = tAmount; S1Color.GetComponent <Image>().fillAmount = s1Amount; S2Color.GetComponent <Image>().fillAmount = s2Amount; if (Math.Abs(Progress - 1) < float.Epsilon) { DoFadingOut(); } }
private void SetUpTSSPositionAndBar() { TBoundary.transform.localPosition = new Vector3(-0.144f * width, 0.1798f * height, 0f); S1Boundary.transform.localPosition = new Vector3(0, 0.1996f * height, 0f); S2Boundary.transform.localPosition = new Vector3(0.1404f * width, 0.17983f * height, 0f); TColor.GetComponent <Image>().fillAmount = 0; S1Color.GetComponent <Image>().fillAmount = 0; S2Color.GetComponent <Image>().fillAmount = 0; }
private void SetActive() { Gen.SetActive(true); Laurence.SetActive(true); Wen.SetActive(true); Wally.SetActive(true); Yu.SetActive(true); QuestionMark.SetActive(true); ExclamationMark.SetActive(true); LaurenceMark.SetActive(true); TBoundary.SetActive(true); TColor.SetActive(true); S1Boundary.SetActive(true); S1Color.SetActive(true); S2Boundary.SetActive(true); S2Color.SetActive(true); }
private void DoFadingOut() { float duration = 1.5f; Wally.GetComponent <Image>().CrossFadeAlpha(0, duration, false); Gen.GetComponent <Image>().CrossFadeAlpha(0, duration, false); Laurence.GetComponent <Image>().CrossFadeAlpha(0, duration, false); Yu.GetComponent <Image>().CrossFadeAlpha(0, duration, false); Wen.GetComponent <Image>().CrossFadeAlpha(0, duration, false); QuestionMark.GetComponent <Image>().CrossFadeAlpha(0, duration, false); ExclamationMark.GetComponent <Image>().CrossFadeAlpha(0, duration, false); LaurenceMark.GetComponent <Image>().CrossFadeAlpha(0, duration, false); TBoundary.GetComponent <Image>().CrossFadeAlpha(0, duration, false); TColor.GetComponent <Image>().CrossFadeAlpha(0, duration, false); S1Boundary.GetComponent <Image>().CrossFadeAlpha(0, duration, false); S1Color.GetComponent <Image>().CrossFadeAlpha(0, duration, false); S2Boundary.GetComponent <Image>().CrossFadeAlpha(0, duration, false); S2Color.GetComponent <Image>().CrossFadeAlpha(0, duration, false); Destroy(); }