using Spine.Unity; using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine; using UnityEngine.EventSystems; public class Checkout_Mon : MonoBehaviour, IPointerClickHandler { // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } /// /// 收入 /// private int Income=0; /// /// 声望 /// private int Fame = 0; /// /// 收入增加 /// /// 增加收入值 public void AddIncome(int income_) { this.Income += income_; } /// /// 开始结算 /// public void StartCheckout() { this.gameObject.SetActive(true); this.transform.Find("金币结算").GetComponent().text = this.Income.ToString(); this.transform.Find("声望结算").GetComponent().text = this.Fame.ToString(); this.transform.Find("结算皇冠").GetComponent().AnimationState.SetAnimation(0, "rc_1", false); this.transform.Find("金币").GetComponent().AnimationState.SetAnimation(0, "rc_1", false); this.transform.Find("双倍金币").GetComponent().AnimationState.SetAnimation(0, "rc_1", false); this.transform.Find("返回店铺").GetComponent().AnimationState.SetAnimation(0, "rc_1", false); } /// /// 返回店铺 /// public void ReturnStore() { this.gameObject.SetActive(false); GameObject.Find("店铺状态").GetComponent().CloseDoor(); } public void OnPointerClick(PointerEventData eventData) { Debug.Log("点击对象" + eventData.pointerCurrentRaycast.gameObject.name); string name_ = eventData.pointerCurrentRaycast.gameObject.name; if (name_ == "返回店铺") { //this.transform.Find("返回店铺").GetComponent().AnimationState.SetAnimation(0, "play_1", false); this.ReturnStore(); } } }