/// <summary> /// 供外部调用的打开接口 by吴江 /// </summary> /// <returns></returns> public virtual GUIBase OpenUI(GUIType _baseOn = GUIType.NONE) { baseOn = _baseOn; if (!this.gameObject.activeSelf) { this.gameObject.SetActive(true); TweenAlphaAllChild x = this.gameObject.GetComponent <TweenAlphaAllChild>(); if (x != null) { x.ResetToBeginning(); x.enabled = true; } subWndDictionary.Clear(); for (int i = 0; i < subWndArray.Length; i++) { if (subWndArray[i] != null) { subWndDictionary[subWndArray[i].type] = subWndArray[i]; } } OnOpen(); } return(this); }
/// <summary> /// 重置数据 /// </summary> void ResetData() { AllAttrNum.Clear(); titleList.Clear(); titleDictionary.Clear(); OwnTitleDictionary.Clear(); curUseTitle = null; isFirstTime = true; ChooseTitle = null; NewTitle = null; }
void UnRegist() { MsgHander.UnRegist(0xD766, S2C_AchievementReachNum); MsgHander.UnRegist(0xD767, S2C_AchievementRewardState); MsgHander.UnRegist(0xD776, S2C_AchievementRedPoint); MsgHander.UnRegist(0xD783, S2C_AchievementToggleRed); achieveNumDic.Clear(); currentAchievementNum = 0; curhaveAchieve.Clear(); redPoint = false; achievementTogRed.Clear(); isGetAchieve = false; }
protected void UnRegist() { MsgHander.UnRegist(0xD705, S2C_GetFriendsList); MsgHander.UnRegist(0xD710, S2C_GetFriendAfterFind); MsgHander.UnRegist(0xD759, S2C_GetInitimacyUpdata); friendsDic.Clear(); friendList.Clear(); allFriendDic.Clear(); list.Clear(); friends.Clear(); items.Clear(); sendFlowerToOne = 0; SendFlowerType = 0; }
/// <summary> /// 注销 /// </summary> void UnRegist() { MsgHander.UnRegist(0xA102, S2C_OnGetPlayerInfoList); MsgHander.UnRegist(0xA104, S2C_OnGetQueueInfo); MsgHander.UnRegist(0xA105, S2C_OnGetQueueEnd); MsgHander.UnRegist(0xA107, S2C_OnCreateCharResult); MsgHander.UnRegist(0xB102, S2C_OnGetMainPlayerInfo); MsgHander.UnRegist(0xD001, S2C_OnGetErrorInfo); MsgHander.UnRegist(0xA10A, S2C_Ping); MsgHander.UnRegist(0xA002, S2C_OnGetSDKBindInfo); MsgHander.UnRegist(0xA004, S2C_OnLoginFailed); isLoadFrom = false; createPlayerInfoDic.Clear(); loginPlayerDic.Clear(); }
protected void UnRegist() { MsgHander.UnRegist(0xE111, S2C_GetMountListInfo); MsgHander.UnRegist(0xE113, S2C_GetMountSkinListInfo); MsgHander.UnRegist(0xD439, S2C_GetMountPromoteLev); MsgHander.UnRegist(0xD440, S2C_GetMountAfterUpdate); MsgHander.UnRegist(0xD757, S2C_GetSkinLevUpdate); MsgHander.UnRegist(0xD575, S2C_OnGotEquipData); MsgHander.UnRegist(0xD576, S2C_OnUpdateEquipData); curMountInfo = null; curSkinLev = 0; skinExp = 0; curLev = -1; mountSkinList.Clear(); mountInfoList.Clear(); AllMountDic.Clear(); AllSkinDic.Clear(); mountList.Clear(); rideType = 0; skinId = 0; state = 0; skinState = false; mountEquipDic.Clear(); curChooseSkin = null; curSelectEquipmentInfo = null; }
/// <summary> /// 删除链式特效 by吴江 /// </summary> public void DeleteLineEffect() { foreach (GameObject item in lineEffectDic.Values) { Destroy(item); } lineEffectDic.Clear(); }
/// <summary> /// 注销 /// </summary> void UnRegist() { MsgHander.UnRegist(0xD022, S2C_TeamMemberResult); MsgHander.UnRegist(0xD023, S2C_TeamMemberUpdate); MsgHander.UnRegist(0xD024, S2C_AskForInvite); MsgHander.UnRegist(0xD026, S2C_AskForJoin); MsgHander.UnRegist(0xD028, S2C_TeamChangeLeader); MsgHander.UnRegist(0xD029, S2C_TeammateOut); MsgHander.UnRegist(0xD030, S2C_TeamDissolve); MsgHander.UnRegist(0xD031, S2C_CancelInvite); MsgHander.UnRegist(0xD032, S2C_CancelJoin); MsgHander.UnRegist(0xE110, S2C_GetNearTeam); //MsgHander.UnRegist(0x3615, S2C_TeamInjury); teammatesDic.Clear(); LeaderId = 0; TeamId = 0; TeamTargetID = 0; }
/// <summary> /// 注销(包含清空和还原数据) /// </summary> protected void UnRegist(MainPlayerMng _father) { MsgHander.UnRegist(0xD309, S2C_GetMagicData); magicInfoDic.Clear(); newRefineLev = 0; newAddSoulLev = 0; newRefineStar = 0; newAddSoulStar = 0; isFirst = true; isAddExp = false; }
/// <summary> /// 注销 /// </summary> void UnRegist() { MsgHander.UnRegist(0xD417, S2C_GetWingData); MsgHander.UnRegist(0xD420, S2C_GetWingUpData); MsgHander.UnRegist(0xD443, S2C_GetWingState); wingDic.Clear(); curWingID = 0; curUseWingInfo = null; needShowWingInfo = null; needShowMountInfo = null; needShowPetInfo = null; modelType = ModelType.NONE; isNotShowTrialWingModel = false; }
public virtual void CleanBuffByReconnect() { if (OnBuffUpdate != null) { foreach (BuffInfo item in buffList.Values) { OnBuffUpdate(item.BuffTypeID, false); } } buffList.Clear(); if (OnCleanBuff != null) { OnCleanBuff(); } }
protected void S2C_ReplyBoxData(Pt _msg) { //Debug.Log("S2C_ReplyBoxData"); pt_reply_royal_box_list_d941 msg = _msg as pt_reply_royal_box_list_d941; if (msg != null) { royalTreasureDic.Clear(); restActiveTimes = (int)msg.rest_acc_times; isOpeningBox = false; for (int i = 0; i < msg.box_list.Count; i++) { royal_box_info data = msg.box_list[i]; //Debug.Log(ConfigMng.Instance.GetRoyalBoxRef((int)data.type).boxItemID); if (data.active == 1)//当前有一个宝箱正在开启 { //Debug.Log("已经开启剩余时间=" + data.rest_time); timeGap = Time.realtimeSinceStartup; if (data.rest_time > 0.00) { isOpeningBox = true; } RoyalBoxRef royalBoxRef = ConfigMng.Instance.GetRoyalBoxRef((int)data.type); //发送消息推送(只发送一次,就在刚开启的时候发送) if (royalBoxRef != null && data.rest_time == royalBoxRef.time) { DateTime newServerTime = GameCenter.instance.CurServerTime; DateTime endTime = newServerTime.AddSeconds((int)data.rest_time); string time = string.Format("{0:D2}:{1:D2}:{2:D2}", endTime.Hour, endTime.Minute, endTime.Second); GameCenter.messageMng.SendPushInfo(2, 1, time); } } if (!royalTreasureDic.ContainsKey(data.id)) { RoyalTreaureData royalData = new RoyalTreaureData(data); royalTreasureDic[data.id] = royalData; } //if(royalTreasureDic.Count>=4)//宝箱位只有4个超过4个提示宝箱格已满 //{ // GameCenter.messageMng.AddClientMsg(486); //} } } if (OnRoyalBoxUpdate != null) { OnRoyalBoxUpdate(); } }
//============================================================ public void LoadFile(string fileName) { // 设置初始数据 _fileName = fileName; _columns.Clear(); _rows.Clear(); // 打开文档 Excel.Application application = null; Excel.Workbook workbook = null; // 读取定义 try{ application = new Excel.Application(); application.UserControl = false; application.ScreenUpdating = false; workbook = application.Workbooks.Open(fileName, 0, true, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing); Excel.Worksheet columnsWorksheet = workbook.Worksheets["定义"]; Excel.Worksheet rowsWorksheet = workbook.Worksheets["数据"]; // 读取文件定义 LoadFileColumns(columnsWorksheet); // 读取数据 LoadFileRows(rowsWorksheet); } finally { // 关闭文档 if (null != workbook) { workbook.Close(false); Marshal.ReleaseComObject(workbook); workbook = null; } if (null != application) { // 释放组件 application.Quit(); Marshal.ReleaseComObject(application); // 必须垃圾回收才能释放 int generation = System.GC.GetGeneration(application); application = null; System.GC.Collect(generation); } } workbook = null; application = null; }
/// <summary> /// 注销 /// </summary> void UnRegist() { MsgHander.UnRegist(0xD402, S2C_GetAllMercenayDataList); MsgHander.UnRegist(0xD404, S2C_FixMercenaryInfo); MsgHander.UnRegist(0xD409, S2C_GetMercenaryPromote); MsgHander.UnRegist(0xD410, S2C_GetUpdataAfterChange); MsgHander.UnRegist(0xD426, S2C_GetPetNewName); MsgHander.UnRegist(0xD751, S2C_GetCopyBook); MsgHander.UnRegist(0xD01F, S2C_EntrouageAwake); mercenaryInfoList.Clear(); petSkillByCopyAll.Clear(); allPetSkillBook.Clear(); choosedBookInMat.Clear(); curPetId = noPet; zhuPetId = noPet; fuPetId = noPet; curUseEggPetId = noPet; emptyNest = 0; choosedSkillId = 0; curPetInfo = null; }
/// <summary> /// 获取周围的队伍信息 /// </summary> /// <param name="_info"></param> protected void S2C_GetNearTeam(Pt _info) { pt_ret_scene_teams_e110 msg = _info as pt_ret_scene_teams_e110; if (msg != null) { //Debug.logger.Log("msg.team_info.Count = " + msg.team_info.Count); nearTeam.Clear(); if (msg.team_info.Count > 0) { for (int i = 0; i < msg.team_info.Count; i++) { NearTeamInfo info = new NearTeamInfo(msg.team_info[i]); nearTeam[info.teamID] = info; } } if (onUpdateNearTeam != null) { onUpdateNearTeam(); } } }
//============================================================ // <T>加载目录。</T> //============================================================ public bool LoadFolder(FObjects <FRsResourceFolder> folder) { // 判断是否为空 if (null == folder) { return(false); } string directory = folder[0].Directory; // 获得所有组件 _resources.Clear(); LoadSubFolder(_resources, folder[0]); // 加载子目录 lvResources.BeginUpdate(); lvResources.Items.Clear(); foreach (INamePair <FRsResource> Pair in _resources) { FRsResource resource = Pair.Value; //if(_showCd == ERsResource.Picture) { // // 获得资源信息 // string typeName = resource.TypeName; // string folderDirectory = resource.Directory; // if(folderDirectory.StartsWith(directory)) { // folderDirectory = folderDirectory.Substring(directory.Length); // } // int id = RInt.Parse(resource.Code); // string label = resource.Label; // bool valid = resource.IsValid; // // 创建列表项目 // ListViewItem qItem = new ListViewItem(); // qItem.ImageKey = typeName; // qItem.Text = " " + id; // if(valid) { // qItem.ForeColor = Color.Black; // qItem.SubItems.Add("O"); // } else { // qItem.ForeColor = Color.Gray; // qItem.SubItems.Add(""); // } // qItem.SubItems.Add(label); // qItem.Tag = resource; // lvResources.Items.Add(qItem); // // 设置附加内容 // //SDsResourceTag tag = resource.Tag as SDsResourceTag; // //tag.item = qItem; // //tag.key = resource.Code + " " + resource.Label; //} else if(_showCd == ERsResource.Animation) { // // 获得资源信息 // string typeName = resource.TypeName; // string folderDirectory = resource.Directory; // if(folderDirectory.StartsWith(directory)) { // folderDirectory = folderDirectory.Substring(directory.Length); // } // int id = RInt.Parse(resource.Code); // string label = resource.Label; // bool valid = resource.IsValid; // // 创建列表项目 // ListViewItem qItem = new ListViewItem(); // qItem.ImageKey = typeName; // qItem.Text = " " + id; // if(valid) { // qItem.ForeColor = Color.Black; // qItem.SubItems.Add("O"); // } else { // qItem.ForeColor = Color.Gray; // qItem.SubItems.Add(""); // } // qItem.SubItems.Add(label); // qItem.Tag = resource; // lvResources.Items.Add(qItem); // // 设置附加内容 // //SRsResourceTag tag = resource.Tag as SRsResourceTag; // //tag.item = qItem; // //tag.key = resource.Id + " " + resource.Code + " " + resource.Label; //} } lvResources.EndUpdate(); return(true); }
//============================================================ // <T>释放内容。</T> //============================================================ public void Dispose() { _names.Clear(); _dataNames.Clear(); }
//============================================================ // <T>释放内容。</T> //============================================================ public void Dispose() { _geometryDictionary.Clear(); _geometryTemps.Clear(); }
/// <summary> /// 初始化窗口 /// </summary> void Awake() { mutualExclusion = true; layer = GUIZLayer.TOPWINDOW; if (npcCompeteTaskPointInstance != null) { npcCompeteTaskPointInstance.SetActive(false); } if (npcUntakeTaskPointInstance != null) { npcUntakeTaskPointInstance.SetActive(false); } if (npcUnCompleteTaskPointInstance != null) { npcUnCompleteTaskPointInstance.SetActive(false); } GameObject obj = Instantiate(mainPlayerPointInstance) as GameObject; MapPlayerHead head = obj.GetComponent <MapPlayerHead>(); if (head != null) { head.Refresh(); } obj.SetActive(true); mainPlayerPoint = obj.transform; if (mapCtrl != null) { mainPlayerPoint.parent = mapCtrl.transform; } mainPlayerPoint.localScale = Vector3.one; mainplayer = GameCenter.curMainPlayer.transform; curScene = GameCenter.curGameStage.SceneID; SceneRef sceneRef = ConfigMng.Instance.GetSceneRef(GameCenter.curGameStage.SceneID); if (mapTexture != null) { mapTexture.SetDimensions((int)(1000 * sceneRef.sceneWidth / sceneRef.sceneLength), (int)(1000 * sceneRef.sceneLength / sceneRef.sceneWidth)); mapTexture.transform.parent = null; if (mapCtrl != null) { mapCtrl.transform.localPosition = new Vector3(-mapTexture.localSize.x / 2, -mapTexture.localSize.y / 2, 0); mapTexture.transform.parent = mapCtrl.transform; } } if (sceneRef != null) { posXRate = mapTexture.localSize.x / sceneRef.sceneWidth; posYRate = mapTexture.localSize.y / sceneRef.sceneLength; } objectInfoDic.Clear(); FDictionary npcInfo = GameCenter.sceneMng.NPCInfoDictionary; foreach (NPCInfo item in npcInfo.Values) { objectInfoDic[item.ServerInstanceID] = new MapInterActiveObjectInfo(item); objectInfoList.Add(objectInfoDic[item.ServerInstanceID] as MapInterActiveObjectInfo); } List <FlyPointRef> flyList = ConfigMng.Instance.GetFlyPointRefByScene(GameCenter.curGameStage.SceneID); if (flyList != null) { for (int i = 0; i < flyList.Count; i++) { objectInfoDic[flyList[i].id] = new MapInterActiveObjectInfo(flyList[i]); objectInfoList.Add(objectInfoDic[flyList[i].id] as MapInterActiveObjectInfo); } } List <MonsterDistributionRef> monsterList = ConfigMng.Instance.GetMonsterDistributionRefByScene(GameCenter.curGameStage.SceneID); if (monsterList != null) { for (int i = 0; i < monsterList.Count; i++) { objectInfoDic[monsterList[i].id] = new MapInterActiveObjectInfo(monsterList[i]); objectInfoList.Add(objectInfoDic[monsterList[i].id] as MapInterActiveObjectInfo); } } if (mapView != null) { mapViewPosX = mapView.transform.localPosition.x; mapViewPosY = mapView.transform.localPosition.y; maxMapViewX = (mapTexture.localSize.x - mapView.GetViewSize().x) / 2; maxMapViewY = (mapTexture.localSize.y - mapView.GetViewSize().y) / 2; } }