完善游戏流程
This commit is contained in:
@@ -152,8 +152,8 @@ namespace Common
|
||||
_progress += 1;
|
||||
yield return new WaitForSeconds(0.02f);
|
||||
}
|
||||
RequestAuthCount = 0;
|
||||
WorldUIManager.Ins.Back();
|
||||
|
||||
Save();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -171,15 +171,22 @@ namespace Common
|
||||
_progress += 1;
|
||||
yield return new WaitForSeconds(0.02f);
|
||||
}
|
||||
RequestAuthCount = 0;
|
||||
WorldUIManager.Ins.Back();
|
||||
|
||||
Save();
|
||||
}
|
||||
else
|
||||
{
|
||||
PanelState.StateChange(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
RequestAuthCount = 0;
|
||||
GameManager.Ins.CreateDoor();
|
||||
WorldUIManager.Ins.Back();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using DG.Tweening;
|
||||
using DragonLi.Core;
|
||||
using LitJson;
|
||||
using Mirror;
|
||||
@@ -14,16 +16,45 @@ public class HUDPanel : MonoBehaviour
|
||||
/// </summary>
|
||||
public TextMeshProUGUI LessTimeText;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 得分文本
|
||||
/// 枪械剩余子弹
|
||||
/// </summary>
|
||||
public TextMeshProUGUI ScoreText;
|
||||
public TextMeshProUGUI gunCountTxt;
|
||||
|
||||
/// <summary>
|
||||
/// 枪械种类
|
||||
/// </summary>
|
||||
public Sprite[] gunIcons;
|
||||
|
||||
/// <summary>
|
||||
/// 枪图片
|
||||
/// </summary>
|
||||
public Image gunImage;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 警告节点
|
||||
/// </summary>
|
||||
public GameObject TimingWarning;
|
||||
|
||||
/// <summary>
|
||||
/// 血条
|
||||
/// </summary>
|
||||
public Image blood2;
|
||||
|
||||
public GameObject hitEffect;
|
||||
|
||||
/// <summary>
|
||||
/// 复活倒计时
|
||||
/// </summary>
|
||||
public GameObject dieUI;
|
||||
|
||||
public TextMeshProUGUI enemyDieCountTxt;
|
||||
|
||||
public Image fuHuoImage;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 下一波倒计时
|
||||
/// </summary>
|
||||
@@ -39,15 +70,30 @@ public class HUDPanel : MonoBehaviour
|
||||
OverlayUIManager.Ins.Cover("UI/HUDPanel", false);
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
GameLocal.Ins.HitUI = hitEffect;
|
||||
GameLocal.Ins.DieUI = dieUI;
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
// LoginPanel.Show();
|
||||
EventDispatcher.AddEventListener<int>("NewWaveStart", NewWaveStart);
|
||||
EventDispatcher.AddEventListener<float, float>("HpChange", HpChange);
|
||||
EventDispatcher.AddEventListener<int>("UserGun", UserGun);
|
||||
EventDispatcher.AddEventListener<int>("WinRound", ShowWinRound);
|
||||
// //打开联控动画
|
||||
// EventDispatcher.AddEventListener<int>("JoinControlStart", JoinControlStart);
|
||||
// //关闭联控动画
|
||||
// EventDispatcher.AddEventListener<int>("JoinControlEnd", JoinControlEnd);
|
||||
}
|
||||
|
||||
public void HpChange(float currentHp, float maxHp)
|
||||
{
|
||||
blood2.fillAmount = currentHp / maxHp;
|
||||
//DOTween.To(() => blood1.fillAmount, x => blood1.fillAmount = x, currentHp / maxHp, 0.5f);//血量变化
|
||||
}
|
||||
|
||||
public void JoinControlStart(int playerIndex)
|
||||
{
|
||||
@@ -80,7 +126,7 @@ public class HUDPanel : MonoBehaviour
|
||||
playerDictionary[key] = entry.Value;
|
||||
}
|
||||
|
||||
ScoreText.text = playerDictionary[GameLocal.Ins.self.index].Score.ToString();
|
||||
//ScoreText.text = playerDictionary[GameLocal.Ins.self.index].Score.ToString();
|
||||
}
|
||||
if (GameManager.Ins.GetLessTimeSeconds() <= 60)
|
||||
{
|
||||
@@ -109,11 +155,27 @@ public class HUDPanel : MonoBehaviour
|
||||
int time = 3;
|
||||
while (time>0)
|
||||
{
|
||||
icon.sprite = RoundIcon[time];
|
||||
icon.sprite = RoundIcon[time-1];
|
||||
yield return new WaitForSeconds(1f);
|
||||
time--;
|
||||
}
|
||||
Round.SetActive(false);
|
||||
GameManager.Ins.PlaySound2DRPC("");
|
||||
}
|
||||
|
||||
|
||||
public void ChangeGunIcon()
|
||||
{
|
||||
gunImage.sprite = gunIcons[GameLocal.Ins.self.NowGunIndex];
|
||||
}
|
||||
|
||||
public void UserGun(int bullet)
|
||||
{
|
||||
gunCountTxt.text = bullet.ToString();
|
||||
}
|
||||
|
||||
public void ShowWinRound(int index)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user