备份CatanBuilding瘦身独立工程
This commit is contained in:
63
Assets/Scripts/Duel/UI/DuelFishProgress.cs
Normal file
63
Assets/Scripts/Duel/UI/DuelFishProgress.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using asap.core;
|
||||
using cfg;
|
||||
using GameCore;
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
public class DuelFishProgress : MonoBehaviour
|
||||
{
|
||||
public GameObject catching;
|
||||
public GameObject nocatched;
|
||||
public GameObject failed;
|
||||
public DuelFishProgressInfo fishInfo;
|
||||
public GameObject finished;
|
||||
IUIService uiService;
|
||||
private void Awake()
|
||||
{
|
||||
uiService = GContext.container.Resolve<IUIService>();
|
||||
}
|
||||
|
||||
public void Catching()
|
||||
{
|
||||
catching.SetActive(true);
|
||||
nocatched.SetActive(false);
|
||||
}
|
||||
public void NoCatched()
|
||||
{
|
||||
catching.SetActive(false);
|
||||
nocatched.SetActive(true);
|
||||
}
|
||||
public void Failed()
|
||||
{
|
||||
catching.SetActive(false);
|
||||
nocatched.SetActive(false);
|
||||
failed.SetActive(true);
|
||||
StartCoroutine(HideFishInfo(failed));
|
||||
}
|
||||
public void ShowFishInfo(FishInfoData data, bool isEnd)
|
||||
{
|
||||
catching.SetActive(false);
|
||||
nocatched.SetActive(false);
|
||||
failed.SetActive(false);
|
||||
fishInfo.gameObject.SetActive(true);
|
||||
Item item = GContext.container.Resolve<Tables>().GetItemData(data.fishItemId);
|
||||
if (item != null)
|
||||
{
|
||||
PlayerFishData.SetFishIcon(fishInfo.icon_fish, item);//鱼头像
|
||||
}
|
||||
fishInfo.text_num_score.SetValue(data.point.ToString(), data.higher);
|
||||
fishInfo.text_num_fishcard.SetValue(data.fishCardAdd.ToString("P0"), data.higherCard);
|
||||
fishInfo.text_num_rod.SetValue(data.fishRodAdd.ToString("P0"), data.higherRod);
|
||||
if (isEnd)
|
||||
{
|
||||
finished.SetActive(true);
|
||||
}
|
||||
StartCoroutine(HideFishInfo(fishInfo.gameObject));
|
||||
}
|
||||
|
||||
IEnumerator HideFishInfo(GameObject hide)
|
||||
{
|
||||
yield return new WaitForSeconds(3f);
|
||||
hide.SetActive(false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user