71 lines
2.1 KiB
C#
71 lines
2.1 KiB
C#
|
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()
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
/// <summary>
|
|||
|
/// <20><><EFBFBD><EFBFBD>
|
|||
|
/// </summary>
|
|||
|
private int Income=0;
|
|||
|
/// <summary>
|
|||
|
/// <20><><EFBFBD><EFBFBD>
|
|||
|
/// </summary>
|
|||
|
private int Fame = 0;
|
|||
|
/// <summary>
|
|||
|
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
/// </summary>
|
|||
|
/// <param name="income_"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ</param>
|
|||
|
public void AddIncome(int income_)
|
|||
|
{
|
|||
|
this.Income += income_;
|
|||
|
}
|
|||
|
/// <summary>
|
|||
|
/// <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>
|
|||
|
/// </summary>
|
|||
|
public void StartCheckout()
|
|||
|
{
|
|||
|
this.gameObject.SetActive(true);
|
|||
|
this.transform.Find("<22><><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>").GetComponent<TextMeshProUGUI>().text = this.Income.ToString();
|
|||
|
this.transform.Find("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>").GetComponent<TextMeshProUGUI>().text = this.Fame.ToString();
|
|||
|
this.transform.Find("<22><><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>").GetComponent<SkeletonGraphic>().AnimationState.SetAnimation(0, "rc_1", false);
|
|||
|
this.transform.Find("<22><><EFBFBD><EFBFBD>").GetComponent<SkeletonGraphic>().AnimationState.SetAnimation(0, "rc_1", false);
|
|||
|
this.transform.Find("˫<><CBAB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>").GetComponent<SkeletonGraphic>().AnimationState.SetAnimation(0, "rc_1", false);
|
|||
|
this.transform.Find("<22><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>").GetComponent<SkeletonGraphic>().AnimationState.SetAnimation(0, "rc_1", false);
|
|||
|
|
|||
|
}
|
|||
|
/// <summary>
|
|||
|
/// <20><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>
|
|||
|
/// </summary>
|
|||
|
public void ReturnStore()
|
|||
|
{
|
|||
|
this.gameObject.SetActive(false);
|
|||
|
GameObject.Find("<22><><EFBFBD><EFBFBD>״̬").GetComponent<Door_Mon>().CloseDoor();
|
|||
|
}
|
|||
|
|
|||
|
public void OnPointerClick(PointerEventData eventData)
|
|||
|
{
|
|||
|
Debug.Log("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" + eventData.pointerCurrentRaycast.gameObject.name);
|
|||
|
string name_ = eventData.pointerCurrentRaycast.gameObject.name;
|
|||
|
if (name_ == "<22><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>")
|
|||
|
{
|
|||
|
//this.transform.Find("<22><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>").GetComponent<SkeletonGraphic>().AnimationState.SetAnimation(0, "play_1", false);
|
|||
|
this.ReturnStore();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|