-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathViewLoading.cs
62 lines (51 loc) · 1.23 KB
/
ViewLoading.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using AssemblyCommon;
using Hotfix.Common;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.UI;
namespace Hotfix.FishingCF
{
public class AShower : IShowDownloadProgress
{
public ViewLoading vl_;
public void Progress(long downed, long totalLength)
{
if(vl_.slider != null) vl_.slider.maxValue = totalLength;
if (vl_.slider != null) vl_.slider.value = downed;
}
public void Desc(string desc)
{
if (vl_.txt != null) vl_.txt.text = desc;
}
public void SetState(DownloadState st)
{
}
}
public class ViewLoading : ViewBase
{
public Slider slider;
public Text txt;
AShower progress2_ = new AShower();
public ViewLoading()
{
progress2_.vl_ = this;
progress = progress2_;
}
protected override void SetLoader()
{
LoadScene("Assets/Res/Games/FishingCF/Scenes/LoginScene.unity", null);
}
protected override IEnumerator OnResourceReady()
{
yield return base.OnResourceReady();
var canvas = GameObject.Find("Canvas");
slider = canvas.FindChildDeeply("Slider").GetComponent<Slider>();
txt = canvas.FindChildDeeply("Text").GetComponent<Text>();
}
}
}