Files
5.24BuYu/Assets/MyGame/aa/Game/DefaultDieEffect/Coin/CoinScript.cs
T
2026-10-11 16:51:07 +08:00

49 lines
1.1 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
public class CoinScript : BJBase
{
public TMP_SpriteAsset goldSprite;
public TMP_SpriteAsset solverSprite;
public GameObject obj_Coin;
public GameObject obj_Gold;
public GameObject obj_Silver;
private void OnEnable()
{
obj_Coin.SetActive(true);
obj_Gold.SetActive(false);
obj_Silver.SetActive(false);
}
public override void SetCoinCount()
{
tMP_CoinCount.text = NumAdd(coinCount.ToString());
var v3 = transform.position;
v3.z = 0;
transform.position = v3;
// 自己爆奖显示金,别人显示银(由 Ws_DieFish 在创建时设置 isLocalCoin)
if (isLocalCoin)
{
tMP_CoinCount.spriteAsset = goldSprite;
}
else
{
tMP_CoinCount.spriteAsset = solverSprite;
}
if (gold != null)
{
gold.SetActive(isLocalCoin);
}
if (silver != null)
{
silver.SetActive(!isLocalCoin);
}
}
}