CommandCallbackType ReceiveEctypeUpdateBlock(byte[] dataBuffer, int socketID) { SMsgEctypeUpDateBlock sMsgEctypeUpDateBlock = SMsgEctypeUpDateBlock.ParsePackage(dataBuffer); BattleManager.Instance.BlockAppear(sMsgEctypeUpDateBlock); return(CommandCallbackType.Continue); }
/// <summary> /// 阻挡生成/消失特效 /// </summary> /// <param name="areaId"></param> public void BlockAppear(SMsgEctypeUpDateBlock sMsgEctypeUpDateBlock) { var mapDynamicData = SceneDataManager.Instance.GetMapDynamicBlockData(sMsgEctypeUpDateBlock.dwareaId, sMsgEctypeUpDateBlock.dwblockGroupID); if (mapDynamicData != null) { var groupId = sMsgEctypeUpDateBlock.dwblockGroupID; if (m_blockStateEffct.ContainsKey(groupId)) { for (int i = 0; i < m_blockStateEffct[groupId].Length; i++) { GameObject.Destroy(m_blockStateEffct[groupId][i]); } m_blockStateEffct.Remove(groupId); } m_blockStateEffct.Add(groupId, new GameObject[mapDynamicData.EffectPos.Length]); if (sMsgEctypeUpDateBlock.byBlockState == 0) { StartCoroutine(SceneDataManager.Instance.ChangeDynamicBlockGroupState(groupId, true, mapDynamicData.FadeDelay)); for (int i = 0; i < mapDynamicData.EffectPos.Length; i++) { m_blockStateEffct[groupId][i] = Instantiate(mapDynamicData.BlockFadeEffect, mapDynamicData.EffectPos[i], Quaternion.Euler(0, mapDynamicData.EffectAngle[i], 0)) as GameObject; } //指引箭头 if (mapDynamicData.GuideArrow == 1) { ShowNextTriggerAreaGuideArrow(mapDynamicData.AreaID + 1); } } else { StartCoroutine(SceneDataManager.Instance.ChangeDynamicBlockGroupState(groupId, false, 0)); for (int i = 0; i < mapDynamicData.EffectPos.Length; i++) { m_blockStateEffct[groupId][i] = Instantiate(mapDynamicData.BlockEffect, mapDynamicData.EffectPos[i], Quaternion.Euler(0, mapDynamicData.EffectAngle[i], 0)) as GameObject; } } } else { TraceUtil.Log(SystemModel.Rocky, "找不到组的阻挡数据:" + sMsgEctypeUpDateBlock.dwblockGroupID); } }