using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using TMPro; public class RacingSuccessPanel : BasePanel { public Button ReturnBtn; public static RacingSuccessPanel instance; public TextMeshProUGUI textSnailEggs;//蜗牛蛋文本 public List images=new List();//显示蜗牛图片 public List sprites = new List();//图片精灵 public List animators = new List();//图片动画 public override void Start() { instance = this; base.Start(); ReturnBtn.onClick.AddListener(OnClickReBtn); } public void OnClickReBtn() { HidePanel(); } public void ShowImage()//设置结算展示图片 { if (AllManeger.instance.WinNos.Count==4) { int index = 0; for (int i = 1; i < images.Count; i++) { SetImage(AllManeger.instance.WinNos[index], images[i]); if (index < AllManeger.instance.WinNos.Count - 1) { index++; } } images[0].gameObject.SetActive(false); images[1].gameObject.SetActive(true); images[2].gameObject.SetActive(true); images[3].gameObject.SetActive(true); images[4].gameObject.SetActive(true); } else if (AllManeger.instance.WinNos.Count == 2) { int index = 0; for (int i=1;i().runtimeAnimatorController = animators[0]; break; case 2: image.sprite = sprites[1]; image.gameObject.GetComponent().runtimeAnimatorController = animators[1]; break; case 3: image.sprite = sprites[2]; image.gameObject.GetComponent().runtimeAnimatorController = animators[2]; break; case 4: image.sprite = sprites[3]; image.gameObject.GetComponent().runtimeAnimatorController = animators[3]; break; case 5: image.sprite = sprites[4]; image.gameObject.GetComponent().runtimeAnimatorController = animators[4]; break; case 6: image.sprite = sprites[5]; image.gameObject.GetComponent().runtimeAnimatorController = animators[5]; break; case 7: image.sprite = sprites[6]; image.gameObject.GetComponent().runtimeAnimatorController = animators[6]; break; case 8: image.sprite = sprites[7]; image.gameObject.GetComponent().runtimeAnimatorController = animators[7]; break; } } }