1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- using System.Collections.Generic;
- using UnityEditor;
- using UnityEngine;
- namespace ET
- {
- public enum ActInfoType
- {
- LightPole = 1,
- BackPole = 2,
- DarkPole = 3,
- Peng = 4,
- Chi = 5
- }
- public class GameUtil : Singleton<GameUtil>
- {
- private Scene scene;
- private List<GameObject> cardCloneItem = new List<GameObject>() { 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<int> 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;
- }
-
-
- public bool CheckIsSame(List<int> 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);
- }
- }
- }
|