using ET; using System; using System.Collections; using System.Collections.Generic; using System.Text.RegularExpressions; using UnityEngine; using Live2D.Cubism.Rendering; using FairyGUI; using UI.MatchingCompetition; namespace GFGGame { class MatchingCompetitionDataManager : SingletonBase { ////搭配赛标记 //public int type = 2; //位置信息数据索引 public int indexRoleData = 0; //人物位置信息 public TransformData roleTransFormData = new TransformData(); public GameObject roleGameobj; //*********************搭配数据********************************* //需要传输的数据:MathingDressDate,DressUpBgID,DressPropIdList,TransformDataList, public DressUpData MathingDressDate = DressUpData.CreateDefault(); public int DressUpBgID = 0; //道具数据,一一对应 //场景名字,自己搭配的数据 public List DressPropNameList = new List(); //道具id public List DressPropIdList = new List(); //道具位置信息 public List TransformDataList = new List(); public List itemGameObjs = new List(); public List _equipSceneData = new List();//当前穿戴的场景数据(从套装获得) //*************************************************************** public int MatchingCompetitionSeason = 1; public int MatchingRemainingTimes = 1; //本期排行榜数据 public List _currentRankList = new List() { new MatchingPlayerData()}; //往期排行榜数据 public Dictionary _beforeRankDic = new Dictionary(); //根据时间判断:1:集结期 2:评选期 3;结算期 public int CheckCompetitionState() { long currentTime = TimeHelper.ServerNow(); DateTime dateTime = DateTimeOffset.FromUnixTimeSeconds(currentTime).DateTime; // 获取星期几 DayOfWeek dayOfWeek = dateTime.DayOfWeek; int week = (int)dayOfWeek; int hour = dateTime.Hour; if(week == 0) { if(hour >= 21) { return 3; } else { return 2; } } if(week <= 3 && week >= 1) { if(week == 3 && hour >= 5) { return 2; } if(week == 1 && hour < 5) { return 3; } return 1; } else if(week > 3 && week <= 6) { return 2; } return -1; } //存储道具信息 public void SetTransformData() { DressPropNameList.Clear(); TransformDataList.Clear(); for (int i =0;i()); // } // _equipSceneData[itemId].Add(itemId); // } //} for(int i =0;i=1) { c2 = index; } if (index > 3 && index <= 9) { c1 = 0; } else if(index >9 && index <= 20) { c1 = 1; } else { c1 = 2; } rankCom.m_c1.selectedIndex = c1; rankCom.m_c2.selectedIndex = c2; if(c1 == 0) { rankCom.m_num3.url = string.Format("ui://MatchingCompetition/{0}",index.ToString()); } else if(c1 == 1) { int one = index / 10; int two = index % 10; rankCom.m_num1.url = string.Format("ui://MatchingCompetition/{0}", one.ToString()); rankCom.m_num2.url = string.Format("ui://MatchingCompetition/{0}", two.ToString()); } else { rankCom.m_RankText.text = index.ToString(); } } public async void AddSceneItem(ItemCfg itemCfg, bool setLayer) { Vector3 pos = Vector3.zero; if (!string.IsNullOrEmpty(itemCfg.resLayer3)) { GameObject parentGameObj3 = new GameObject(string.Format("{0}_{1}", itemCfg.id, 3)); await PhotographSceneManager.Instance.AddSceneItem(parentGameObj3, itemCfg, 3, setLayer); if (setLayer) { if (parentGameObj3.transform.childCount > 0) { parentGameObj3.transform.localPosition = -parentGameObj3.transform.GetChild(0).localPosition; pos = parentGameObj3.transform.localPosition; } } } if (!string.IsNullOrEmpty(itemCfg.resLayer2)) { GameObject parentGameObj2 = new GameObject(string.Format("{0}_{1}", itemCfg.id, 2)); await PhotographSceneManager.Instance.AddSceneItem(parentGameObj2, itemCfg, 2, setLayer); if (setLayer) { if (parentGameObj2.transform.childCount > 0) { parentGameObj2.transform.localPosition = pos == Vector3.zero ? -parentGameObj2.transform.GetChild(0).localPosition : pos; pos = parentGameObj2.transform.localPosition; } } } if (!string.IsNullOrEmpty(itemCfg.resLayer1)) { GameObject parentGameObj1 = new GameObject(string.Format("{0}_{1}", itemCfg.id, 1)); await PhotographSceneManager.Instance.AddSceneItem(parentGameObj1, itemCfg, 1, setLayer); if (setLayer) { if (parentGameObj1.transform.childCount > 0) { parentGameObj1.transform.localPosition = pos == Vector3.zero ? -parentGameObj1.transform.GetChild(0).localPosition : pos; pos = parentGameObj1.transform.localPosition; } } } } public void OnClickBtnRule() { ViewManager.Show(); } } class OtherMatchingCompetitionDataManager : SingletonBase { //其他玩家信息用于展示 //人物位置信息 public TransformData roleTransFormData = new TransformData(); public GameObject roleGameobj; //*********************搭配数据********************************* //需要传输的数据:MathingDressDate,DressUpBgID,DressPropIdList,TransformDataList, public DressUpData MathingDressDate = DressUpData.CreateDefault(); public int DressUpBgID = 0; //道具数据,一一对应 //场景名字,自己搭配的数据 public List DressPropNameList = new List(); //道具id public List DressPropIdList = new List(); //道具位置信息 public List TransformDataList = new List(); public List itemGameObjs = new List(); public List _equipSceneData = new List();//当前穿戴的场景数据 //*************************************************************** } }