Commit d7046574 authored by czy's avatar czy

吃金币的文字效果

parent e8cde210
......@@ -47,6 +47,10 @@ public class BattleUI : MonoBehaviour
public Text text1;
public Text text2;
public Text text3;
[Header("钱袋")]
public Image PurseImg;
public GameObject Text100C;
public Text PurseText;
public Action onStartBtn;
public Action onPosUpBtn;
......@@ -66,8 +70,10 @@ public class BattleUI : MonoBehaviour
private Image m_thumbImage;
public bool IsLeftEmtryBomb { get { return m_bombIndex >= 3; } }//是否不剩炸弹了
public bool IsBombButtonCanInteractable { get { return m_boomBtn.interactable; } }
public static BattleUI instance;
void Awake()
{
instance = this;
m_dragBtn.onClick.AddListener(SetDragMode);
m_moveBtn.onClick.AddListener(SetMoveMode);
m_restartBtn.onClick.AddListener(LoadCurLevel);
......@@ -384,6 +390,7 @@ public class BattleUI : MonoBehaviour
{
sliderScore.value = BattleCtrl.instance.Score;
ScoreTex.text = BattleCtrl.instance.Score.ToString();
PurseText.text= BattleCtrl.instance.Score.ToString();
}
public void UpdateRanking()
{
......@@ -416,6 +423,20 @@ public class BattleUI : MonoBehaviour
//text2.text = DoRanking._instance.rankingList[1].name;
//text3.text = DoRanking._instance.rankingList[0].name;
}
public void GenerateAddMoneyUI(int number,Vector2 screenPoint)
{
switch (number)
{
case 100:
Instantiate(Text100C, new Vector3(screenPoint.x, screenPoint.y, 0), PurseImg.gameObject.transform.rotation, PurseImg.gameObject.transform);
break;
default: Debug.LogError("没有该分数的UI");
break;
}
}
void OnDestroy()
{
BattleCtrl.instance.updateScore -= UpdateScore;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment