private void UIGetIn() { StartCoroutine(DelayToInvoke.DelayToInvokeDo(() => { UICollection.AlphaFade(UIElementsList[0], true); }, 0.5f)); StartCoroutine(DelayToInvoke.DelayToInvokeDo(() => { UICollection.AlphaFade(UIElementsList[1], true); GameObject role = element2[1].gameObject; RectTransform roleRect = role.GetComponent <RectTransform>(); GameObject shadow = element2[0].gameObject; RectTransform shadowRect = role.GetComponent <RectTransform>(); UICollection.MoveToPos(role, new Vector3(0f, roleRect.localPosition.y, roleRect.localPosition.z), 0.15f); UICollection.MoveToPos(shadow, new Vector3(0f, shadowRect.localPosition.y, shadowRect.localPosition.z), 0.15f); }, 1.0f)); StartCoroutine(DelayToInvoke.DelayToInvokeDo(() => { UICollection.AlphaFade(UIElementsList[3], true); int i = 0; foreach (Image item in element4) { GameObject obj = element4[i].gameObject; RectTransform rect = obj.GetComponent <RectTransform>(); UICollection.MoveToPos(obj, new Vector3(rect.localPosition.x, -80f * i, rect.localPosition.z), 0.2f); i++; } }, 1.5f)); StartCoroutine(DelayToInvoke.DelayToInvokeDo(() => { UICollection.AlphaFade(element3Img.gameObject, true, 0.7f); }, 2.0f)); StartCoroutine(DelayToInvoke.DelayToInvokeDo(() => { UICollection.AlphaFade(element3Text.gameObject, true); }, 2.0f)); }
private void SetPosAndEffect() { if (m_index - 1 < 0) { return; } RectTransform m_last_rect = blockTextList[m_index - 1].m_rect; m_last_rect.localScale = new Vector3(1, 1, 1); float posX = m_last_rect.localPosition.x + m_last_rect.rect.width; float posY = m_last_rect.localPosition.y; if (IsNeedChangeRow(posX) || IsForceChangeRow) { posY = posY - m_rect.rect.height; posX = blockTextList[0].m_rect.localPosition.x; } float posZ = m_last_rect.localPosition.z; Vector3 newPos = new Vector3(posX, posY, posZ); Vector3 pos = new Vector3(newPos.x, newPos.y + 20f, newPos.z); m_rect.localPosition = pos; UICollection.MoveToPos(gameObject, newPos, 0.8f); UICollection.AlphaFadeText(gameObject, false); //Debug.Log("原始坐标位置:" + newPos); //Debug.Log("BlockTextList长度:" + blockTextList.Count); }
public void ChangeDisc(CdBoxControl control) { //切换歌曲列表 track = control.track; musicList.Clear(); foreach (CdData.OneMusic music in track.musicList) { AudioClip clip = Resources.Load <AudioClip>("Musics/" + music.musicName); musicList.Add(clip); } Image cdSmallImage = control.cdSmallImage; StartCoroutine(DelayToInvoke.DelayToInvokeDo(() => { UICollection.MoveToPos(cdSmallImage.gameObject, control.MoveTargetPos, 0.2f); }, 0.0f)); StartCoroutine(DelayToInvoke.DelayToInvokeDo(() => { UICollection.AlphaFadeImg(cdSmallImage.gameObject, false); }, 0.2f)); StartCoroutine(DelayToInvoke.DelayToInvokeDo(() => { NeedleOut(); UICollection.AlphaFadeImg(discImage.gameObject, false); DiscStopRotating(); }, 1f)); StartCoroutine(DelayToInvoke.DelayToInvokeDo(() => { NeedleIn(5.0f); UICollection.SetImage(control.cdSmallImage.sprite, discImage); UICollection.AlphaFadeImg(discImage.gameObject, true); control.isChanging = false; control.isSelected = true; }, 2f)); StartCoroutine(DelayToInvoke.DelayToInvokeDo(() => { DiscStartRotating(); audioSource.Play(); musicNameText.text = audioSource.clip.name; ChangeToPauseSpr(); UICollection.SetImage(pauseBtn.upSpr, pauseBtn.gameObject.GetComponent <Image>()); }, 2.5f)); }