43 lines
964 B
C#
43 lines
964 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using DG.Tweening;
|
|
using DragonSoul.Shared;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace UnityTest.ZXL
|
|
{
|
|
//章节
|
|
public class ChapterUI : UI
|
|
{
|
|
public List<GameObject> images = new List<GameObject>();
|
|
public Image blackImage;
|
|
|
|
private void ShowChapter(int index)
|
|
{
|
|
HideAll();
|
|
images[index].SetActive(true);
|
|
blackImage.color = new Color(0, 0, 0, 0);
|
|
}
|
|
|
|
private void HideAll()
|
|
{
|
|
foreach (var image in images)
|
|
{
|
|
image.SetActive(false);
|
|
}
|
|
}
|
|
|
|
public async ETTask Transit(int index)
|
|
{
|
|
ShowChapter(index);
|
|
|
|
await ETTaskHelper.WaitTime(1);
|
|
|
|
blackImage.DOColor(new Color(0, 0, 0, 1), 1);
|
|
await ETTaskHelper.WaitTime(1);
|
|
|
|
// 加载后面的内容
|
|
}
|
|
}
|
|
} |