77 lines
2.0 KiB
C#
77 lines
2.0 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class HouseBtn : MonoBehaviour
|
|
{
|
|
public int escapeId;//游戏id
|
|
public int roomNo;//房间号
|
|
public float roomBeansCoin;//房间里面的钱
|
|
public int roomUserNo;//房间里面的人数
|
|
public Button btn;
|
|
public GameObject Mask;
|
|
public RectTransform door;
|
|
public GameObject text;
|
|
public GameObject post;//最终点
|
|
public GameObject bg;
|
|
public GameObject wn;
|
|
//public selectLatest511.GameEscapeRoomResponseVo gameEscapeRoomResponseVo;
|
|
public bool DoorIsOpen;
|
|
public PlayerMovePos woniuMovePos;
|
|
public List<otherWoniu> otherWonius;
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
if (GetComponent<Button>()!= null)
|
|
{
|
|
btn=GetComponent<Button>();
|
|
btn.onClick.AddListener(OnClickBtn);
|
|
}
|
|
|
|
|
|
}
|
|
|
|
public void OnClickBtn()
|
|
{
|
|
|
|
|
|
if (!bg.GetComponent<AllHouseContro>().is_jisha)
|
|
{
|
|
|
|
if (PlayerInfo.instance.HaveBet)
|
|
{
|
|
if (bg.GetComponent<AllHouseContro>().roomNo!=roomNo)
|
|
{
|
|
bg.GetComponent<AllHouseContro>().roomNo = roomNo;
|
|
BettingBtn.instance.BetAgain(() => {
|
|
transform.GetComponent<PlayerMove>().StartMove();
|
|
woniuMovePos.HadChoise = true;
|
|
});//再次投注,换房子
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
else
|
|
{
|
|
if (bg.GetComponent<AllHouseContro>().roomNo != roomNo)
|
|
{
|
|
bg.GetComponent<AllHouseContro>().roomNo = roomNo;
|
|
|
|
transform.GetComponent<PlayerMove>().StartMove();
|
|
woniuMovePos.HadChoise = true;
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|