修改胜利界面Bug

This commit is contained in:
GL 2024-12-27 23:41:04 +08:00
parent 9a69d23e3c
commit a6324eadd1
6 changed files with 37 additions and 18 deletions

View File

@ -348,6 +348,7 @@ MonoBehaviour:
AttackCD: 0
CritRate: 0
CriticalHitRateBonus: 0
killNum: 0
gold: 10
MaxAttack: 10
MinAttack: 10
@ -435,6 +436,8 @@ MonoBehaviour:
isHit: 0
myTags: 10
mySkillUp: {fileID: 0}
IsDead: 0
HaveDieTime: 0
enemyId:
moveSpeed: 2
MengyaoSprite: {fileID: 0}
@ -619,7 +622,7 @@ SpriteRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 645dca14ffff13041862597ed96cee91, type: 3}
m_Sprite: {fileID: 21300000, guid: aa6f66265746cb041bbfdf887abe64f9, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0

View File

@ -429,8 +429,8 @@ MonoBehaviour:
m_EditorClassIdentifier:
panel: {fileID: 1531406980403464475}
close: {fileID: 1206893118731475948}
shanghai: {fileID: 0}
shanghaiJiaobeng: {fileID: 0}
shanghai: {fileID: 5763259998259026631}
shanghaiJiaobeng: {fileID: 7416072157676955320}
--- !u!1 &773093349700575190
GameObject:
m_ObjectHideFlags: 0
@ -3629,9 +3629,9 @@ MonoBehaviour:
toggle2: {fileID: 4533124664872313552}
tipsText: {fileID: 4931159036147832419}
jiangli: {fileID: 6130145704757712620}
jiangliJiaobeng: {fileID: 0}
jiangliJiaobeng: {fileID: 7497656462379138799}
shanghai: {fileID: 3672058253625160348}
shanghaiJiaobeng: {fileID: 0}
shanghaiJiaobeng: {fileID: 2816802735624181618}
panel: {fileID: 1531406980403464475}
close: {fileID: 1611523547142466811}
--- !u!1 &6447564337535396723

View File

@ -8,12 +8,14 @@ public class Challeng_Evictory : Base
public GameObject Victory;
public GameObject failur;
void Start()
{
Victory.SetActive(false);
failur.SetActive(false);
//Show(true);
}
private void Awake()
{
Victory.SetActive(false);
failur.SetActive(false);
}
/// <summary>
/// 生成true为胜利false为失败
@ -21,8 +23,11 @@ public class Challeng_Evictory : Base
/// <param name="TorF">true为胜利false为失败</param>
public async void Show(bool TorF)
{
await Init();
if (TorF)
await Task.Delay(200);
await Init();
if (TorF)
{
Victory.SetActive(true);
await ButtonClickAnimationAsync(Victory,0.8f,0.6f);

View File

@ -120,7 +120,9 @@ public class UIContorl : Base
public void GameVictory()
{
Instantiate(VictoryPanel,this.transform);
GameObject go = Instantiate(VictoryPanel,this.transform);
go.GetComponent<Challeng_Evictory>().Show(true);
}
public void GameOver()

View File

@ -11,9 +11,14 @@ public class failurePanel : MonoBehaviour
[Header("伤害统计")] public GameObject shanghai;
[Header("脚本")] public shanghai shanghaiJiaobeng;
// Start is called before the first frame update
private void Awake()
{
//shanghaiJiaobeng = shanghai.GetComponent<shanghai>();
}
void Start()
{
shanghaiJiaobeng = shanghai.GetComponent<shanghai>();
close.onClick.AddListener(() =>
{

View File

@ -18,13 +18,17 @@ public class victoryPanel : MonoBehaviour
[Header("关闭的面板")] public GameObject panel;
[Header("closeBTN")] public Button close;
private void Awake()
{
/*shanghaiJiaobeng = shanghai.GetComponent<shanghai>();
jiangliJiaobeng = jiangli.GetComponent<jiangli>();*/
}
void Start()
{
shanghaiJiaobeng=shanghai.GetComponent<shanghai>();
jiangliJiaobeng = jiangli.GetComponent<jiangli>();
toggle1.onValueChanged.AddListener((isOn) =>
{