1
This commit is contained in:
73
unity/Assets/Script/UI/UILoading.cs
Normal file
73
unity/Assets/Script/UI/UILoading.cs
Normal file
@@ -0,0 +1,73 @@
|
||||
using Manager;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class UILoading : MonoBehaviour
|
||||
{
|
||||
public GameObject UIBegin;
|
||||
public GameObject UITip;
|
||||
//public GameObject UISaveDate;
|
||||
// Start is called before the first frame update
|
||||
private void Awake()
|
||||
{
|
||||
DateInit();
|
||||
}
|
||||
IEnumerator Start()
|
||||
{
|
||||
Debug.Log("GameStart");
|
||||
UITip.SetActive(true);
|
||||
UIBegin.SetActive(false);
|
||||
|
||||
yield return new WaitForSeconds(2.5f);
|
||||
SoundManager.Instance.PlayMusic(SoundDefine.LoadingMusic);
|
||||
yield return new WaitForSeconds(0.5f);
|
||||
|
||||
UITip.SetActive(false);
|
||||
UIBegin.SetActive(true);
|
||||
}
|
||||
|
||||
public void Init()
|
||||
{
|
||||
UITip.SetActive(false);
|
||||
UIBegin.SetActive(true);
|
||||
}
|
||||
public void ClickSet()
|
||||
{
|
||||
//SoundManager.Instance.PlaySound(SoundDefine.ButtonClick);
|
||||
UIManager.Instance.Show<UISetting>();
|
||||
}
|
||||
public void ClickContinue()
|
||||
{
|
||||
//SoundManager.Instance.PlaySound(SoundDefine.ButtonClick);
|
||||
//UISaveDate.SetActive(true);
|
||||
UIBegin.SetActive(false);
|
||||
UIManager.Instance.Show<UISaveDate>();
|
||||
}
|
||||
|
||||
//所有配置初始化
|
||||
public void DateInit()
|
||||
{
|
||||
Date.Instance.ItemDate.Clear();
|
||||
Date.Instance.UpDate.Clear();
|
||||
//数据初始化
|
||||
Date.Instance.ItemDate.Add(new Item { Id = 0, ItemName = "永恒之心", Descripte = "怪物的心脏,可以用于升级", Path = "Item/01", type = ItemClass.Up });
|
||||
//Date.Instance.ItemDate.Add(new Item { Id = 1, ItemName = "进阶之梯" ,Path= "Item/02", Descripte = "可以用于进阶", type = ItemClass.Up });
|
||||
Date.Instance.ItemDate.Add(new Item { Id = 1, ItemName = "生命女神的血", Path = "Item/03", Descripte = "来自生命女神的体内,可以战斗中回血", type = ItemClass.User, lotteryType = LotteryType.Hp, value = 50 });
|
||||
//Date.Instance.DateDefine.Add(new Item { Id = 2, ItemName = "魔刀千刃" });
|
||||
|
||||
Date.Instance.UpDate.Add(new LevelUpDefine { UpId = 0, PreId=0,Active = false, userId = 0, useNum = 2, type = LotteryType.UpMaxHp, value = 50 });
|
||||
|
||||
Date.Instance.UpDate.Add(new LevelUpDefine { UpId = 1, PreId = 0, Active = false, userId = 0, useNum = 4, type = LotteryType.UpHp, value = 50 });
|
||||
Date.Instance.UpDate.Add(new LevelUpDefine { UpId = 2, PreId = 1, Active = false, userId = 0, useNum = 6, type = LotteryType.UpAttack, value = 20 });
|
||||
|
||||
Date.Instance.UpDate.Add(new LevelUpDefine { UpId = 3, PreId = 0, Active = false, userId = 0, useNum = 4, type = LotteryType.UpHp, value = 50 });
|
||||
Date.Instance.UpDate.Add(new LevelUpDefine { UpId = 4, PreId = 1, Active = false, userId = 0, useNum = 6, type = LotteryType.UpAttack, value = 20 });
|
||||
|
||||
Date.Instance.UpDate.Add(new LevelUpDefine { UpId = 5, PreId = 2, Active = false, userId = 0, useNum = 8 , type = LotteryType.UpAttack, value = 20 });
|
||||
Date.Instance.UpDate.Add(new LevelUpDefine { UpId = 6, PreId = 2, Active = false, userId = 0, useNum = 8, type = LotteryType.UpMaxHp, value = 50 });
|
||||
|
||||
Date.Instance.UpDate.Add(new LevelUpDefine { UpId = 7, PreId = 4, Active = false, userId = 0, useNum = 8, type = LotteryType.UpAttack, value = 20 });
|
||||
Date.Instance.UpDate.Add(new LevelUpDefine { UpId = 8, PreId = 4, Active = false, userId = 0, useNum = 8, type = LotteryType.UpMaxHp, value = 50 });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user