using System.Collections.Generic; using UnityEditor; using UnityEngine; namespace ET { public enum ActInfoType { LightPole = 1,//明 BackPole = 2,//回 // DarkPole = 3,//暗 // 手上3 外面1 Peng = 4,//碰 Chi = 5//吃 } public class GameUtil : Singleton { private Scene scene; private List cardCloneItem = new List() { null,null}; public int curRequestCardVal = -1; public int curCardVal = -1; public Vector2 myHandCardSize = new Vector2(89,135); public Vector2 myShowCard = new Vector2(69,90); public Vector2 otherHandCardSize = new Vector2(80,59); public Vector2 otherLeftCardSize = new Vector2(70,49); public void SetSceneComponent(Scene scene) { this.scene = scene; } public Scene GetSceneComponent() { return this.scene; } public void SetCardCloneItem(GameObject item,int index) { this.cardCloneItem[index] = item; } public GameObject GetCardCloneItem(int index) { return this.cardCloneItem[index]; } public bool CheckIsSequence(List cards) { if (cards == null || cards.Count < 3) { return false; } cards.Sort(); int first = cards[0]; for (int i = 1;i < cards.Count;i++) { if (first + 1 != cards[i]) { return false; } first = cards[i]; } return true; } //type == 0 碰 //type == 1 gang public bool CheckIsSame(List cards,int type) { int count = type == 0? 3 : 4; if (cards == null || cards.Count < count) { return false; } cards.Sort(); int first = cards[0]; for (int i = 1; i < cards.Count; i++) { if (first != cards[i]) { return false; } } return true; } public GameObject InitializeObj(GameObject obj) { return UnityEngine.Object.Instantiate(obj); } } }