public static void ReleaseUIMeshCamera(Camera _camera) { instance.m_UIMeshCameraCount--; var temp1 = _camera.gameObject; ResNode.DestroyRes(ref temp1); }
public void onClickClose() { var temp1 = gameObject; ResNode.DestroyRes(ref temp1); OnCloseDelegate(m_Type); }
public void OnShowKinMemberWnd(int nKinID) { // 清空KinMemberFrame int nCount = KinMemberListFrame.childCount; for (int i = nCount - 1; i >= 0; --i) { Transform childTrans = KinMemberListFrame.GetChild(i); if (childTrans) { var temp = childTrans.gameObject; ResNode.DestroyRes(ref temp); } } // 填充数据 List <cmd_legendcup_competition_kinmembernode> memberList = LogicDataCenter.legendCupDataManager.GetKinMemberInfo(nKinID); if (memberList == null) { return; } KinMemberTemplate.SetActive(true); cmd_legendcup_recv_regist_memberlistnode tempNode = new cmd_legendcup_recv_regist_memberlistnode(); m_kinMemberItems = new LegendCupRegistKinMemberItem[memberList.Count]; for (int i = 0; i < memberList.Count; ++i) { GameObject memberItemObj = ResNode.InstantiateRes(KinMemberTemplate); if (!memberItemObj) { return; } m_kinMemberItems[i] = memberItemObj.GetComponent <LegendCupRegistKinMemberItem>(); if (!m_kinMemberItems[i]) { return; } tempNode.uDBID = memberList[i].nUserID; tempNode.nPDBID = memberList[i].nPDBID; tempNode.nActorSex = memberList[i].nActorSex; tempNode.nActorLevel = memberList[i].nActorLevel; tempNode.szActorName = memberList[i].szActorName; tempNode.nType = memberList[i].nType; tempNode.nRankGrade = memberList[i].nRankGrade; tempNode.nRankScore = memberList[i].nRankScore; tempNode.nRankIconId = memberList[i].nRankIconId; tempNode.szGradeName = memberList[i].szGradeName; m_kinMemberItems[i].SetData(tempNode); memberItemObj.name = "MemberItem" + (i + 1); RectTransform rectTrans = memberItemObj.transform as RectTransform; rectTrans.SetParent(KinMemberListFrame, false); } KinMemberTemplate.SetActive(false); }
public void OnShowLegndCupPrizeWnd(long lLegendCupID) { cmd_legendcup_recv_cuplist_node cupBaseData = LogicDataCenter.legendCupDataManager.GetSingleLegendCupNode(lLegendCupID); if (cupBaseData.nLegendCupID == 0) { return; } TotalBonusCount.text = cupBaseData.nCompetitionBonus.ToString(); // 清空DetailPrizeFrame int nCount = DetailPrizeFrame.childCount; for (int j = nCount - 1; j >= 0; j--) { Transform childTrans = DetailPrizeFrame.GetChild(j); if (childTrans) { var temp = childTrans.gameObject; ResNode.DestroyRes(ref temp); } } SSchemeLegendCupConfig cupConfig = LegendCupConfig.Instance.GetCupConfig(cupBaseData.nCupConfigID); if (cupConfig == null) { return; } List <SSchemeLegendCupPrizeConfig> prizeConfigList = LegendCupConfig.Instance.GetCupPrizeConfig(cupConfig.nPrizeConfigID); if (prizeConfigList == null) { return; } m_DetailPrizeItems = new LegendCupDetailPrizeItem[prizeConfigList.Count]; for (int i = 0; i < prizeConfigList.Count; i++) { GameObject detailPrizeObj = ResNode.InstantiateRes(DetailPrizeTemplate); if (!detailPrizeObj) { return; } RectTransform rectTrans = detailPrizeObj.transform as RectTransform; rectTrans.SetParent(DetailPrizeFrame, false); m_DetailPrizeItems[i] = detailPrizeObj.GetComponent <LegendCupDetailPrizeItem>(); if (!m_DetailPrizeItems[i]) { return; } m_DetailPrizeItems[i].SetData(prizeConfigList[i], cupBaseData.nCompetitionBonus); } DetailPrizeTemplate.SetActive(false); }
void ClearContainer(RectTransform container) { for (int i = container.childCount - 1; i >= 0; --i) { var temp = container.GetChild(i).gameObject; ResNode.DestroyRes(ref temp); } }
public void OnDestroy() { if (m_image != null) { var temp = m_image.gameObject; ResNode.DestroyRes(ref temp); } }
/// <summary> /// 离开本控制器接管 /// </summary> public override void Leave() { if (m_camRecTrans) { var temp = m_camRecTrans.gameObject; ResNode.DestroyRes(ref temp); } }
/// <summary> /// 清除材质球实例 /// </summary> public void ClearMaterialInstance() { if (InstanceMaterial) { ResNode.DestroyRes(ref InstanceMaterial); InstanceMaterial = null; } }
public void removeAllChild() { // 删除现有子对象 for (int i = this.transform.childCount - 1; i >= 0; --i) { var temp = this.transform.GetChild(i).gameObject; ResNode.DestroyRes(ref temp); } }
public static void API_UnLoadAllLevel() { foreach (SceneResInfoManager re in LoadedScene_ResTable.Values) { ResNode.DestroyRes(ref re.SceneRoot); } LoadedScene_ResTable.Clear(); }
private void UpdateServerList(List <gamelogic_district_info> groupList) { int nCount = ServerList.transform.childCount; for (int i = nCount - 1; i >= 0; --i) { Transform childTrans = ServerList.transform.GetChild(i); if (childTrans) { GameObject go = childTrans.gameObject; // 销毁obj ResNode.DestroyRes(ref go); } } for (int i = 0; i < groupList.Count; i++) { GameObject serverGo = ResNode.InstantiateRes(DefaultServerItem); if (serverGo != null) { serverGo.transform.SetParent(ServerList.transform, false); serverGo.GetComponent <UButtonGroupItem>().Group = ServerList; serverGo.SetActive(true); Text btnLabel = serverGo.GetComponentInChildren <Text>(); if (btnLabel) { btnLabel.text = groupList[i].szName; } //正常 if (groupList[i].nState < 2) { Transform icon_Green = serverGo.transform.FindChild("Icon_Green"); if (icon_Green) { icon_Green.gameObject.SetActive(true); } } else//爆满 { Transform icon_Red = serverGo.transform.FindChild("Icon_Red"); if (icon_Red) { icon_Red.gameObject.SetActive(true); } } DistrictInfo districtInfo = serverGo.GetComponent <DistrictInfo>(); if (districtInfo != null) { districtInfo.SetData(i, groupList[i].nGroup, groupList[i].nDistrict, groupList[i].nServer); } } } }
public void Awake() { bodyobj = gameObject; //以后应该用下面的异步加载时的方法 Animator a = GetComponent <Animator>(); if (a != null && a.runtimeAnimatorController == null) { ResNode.DestroyRes(ref a); } }
public static void API_UnLoadLevel(string sceneName) { SceneResInfoManager mr = null; if (LoadedScene_ResTable.TryGetValue(sceneName, out mr)) { ResNode.DestroyRes(ref mr.SceneRoot); LoadedScene_ResTable.Remove(sceneName); } }
/// <summary> /// 设置游戏对象 /// </summary> /// <param name="gameObject">游戏对象</param> public void SetGameObject(GameObject gameObject) { if (m_gameObject) { Debug.LogError("EntityView Error,gameobject is not null!" + m_gameObject.name + ",isValid:" + m_isValid + ",chidCout:" + m_gameObject.transform.childCount); ResNode.DestroyRes(ref m_gameObject); } m_gameObject = gameObject; }
public void Clear() { isBeCached = false; if (m_MainAnimator) { m_MainAnimator.runtimeAnimatorController = orginalAnimatorController; } m_nSkinID = -1; m_SkinObj = null; m_SkinObj_B = null; m_SkinObj_A = null; m_MainAnimator = null; m_AnimatorB = null; m_bipedIKAnimator = null; m_creatureProperty = null; m_ReferencedSkinCtrl = null; m_SkinnedMeshRenderList.Clear(); m_MeshRenderList.Clear(); m_AllRenders.Clear(); m_cameraProperty = null; m_characterController = null; m_entitySkinConfig = null; if (m_playEntityStaticEffect) { m_playEntityStaticEffect.Clear(); } if (m_switchEffectWithHeroDistance) { m_switchEffectWithHeroDistance.Clear(); } m_playEntityStaticEffect = null; m_switchEffectWithHeroDistance = null; m_sidekickEntity = null; m_SkinDataObj = null; foreach (RenderVisibleHelper vis in m_VisibleHelperList) { vis.hostSkin = null; var temp1 = vis; ResNode.DestroyRes(ref temp1); } ResNode.DestroyRes(ref m_bindEffect_A); ResNode.DestroyRes(ref m_bindEffect_B); ResNode.DestroyRes(ref m_bindSound); ResNode.DestroyRes(ref m_overrideController); m_VisibleHelperList.Clear(); ResNode.DestroyRes(ref m_characterShadow); ClearAlpha(); ClearBonesMap(); m_isLoadFinish = false; }
public static void Clear() { foreach (PrefabNode pn in m_PrefabMap.Values) { pn.Clear(); } //清掉引用,再调用UnLoad就行了 m_PrefabMap.Clear(); ResNode.DestroyRes(ref PrefabCacheRoot); Resources.UnloadUnusedAssets(); }
public void OnShowCreateTypeWnd() { int nTypeCount = CupTypeFrame.childCount; for (int i = nTypeCount - 1; i >= 0; i--) { Transform typeRect = CupTypeFrame.GetChild(i); if (typeRect) { var temp = typeRect.gameObject; ResNode.DestroyRes(ref temp); } } List <SSchemeLegendCupTypeConfig> typeConfigList = LegendCupConfig.Instance.GetCupTypeConfigList(); if (typeConfigList == null || typeConfigList.Count <= 0) { return; } m_typeItem.Clear(); int index = 0; CupTypeBtnGroup.UseGroupIndex = true; foreach (SSchemeLegendCupTypeConfig config in typeConfigList) { if (config.nIsShow <= 0) { continue; } GameObject typeObj = ResNode.InstantiateRes(CupTypeTemplate); if (!typeObj) { return; } RectTransform typeTrans = typeObj.transform as RectTransform; typeTrans.SetParent(CupTypeFrame, false); LegendCupTypeItem typeItem = typeObj.GetComponent <LegendCupTypeItem>(); typeItem.SetData(this, config.nCreateType); m_typeItem.Add(typeItem); UButtonGroupItem btnItem = typeObj.GetComponent <UButtonGroupItem>(); btnItem.GroupIndex = index++; btnItem.Group = CupTypeBtnGroup; typeObj.SetActive(true); } CupTypeTemplate.SetActive(false); CupTypeBtnGroup.onButtonGroupSelectedChange.RemoveListener(OnButtonChange); CupTypeBtnGroup.onButtonGroupSelectedChange.AddListener(OnButtonChange); CupTypeBtnGroup.SetItemSelectedItem(0); }
void OcclusCullingInit() { if (!GoablEnabledOcclusCulling) { ResNode.DestroyRes(ref ScenereOcclusColliderRoot); return; } InitScreenInfo(); BuildOcclusCacheData(); }
protected override void onExit(TBTWorkingData wData, int runningStatus) { base.onExit(wData, runningStatus); SceneEffectManager.Instance.DestroySceneEffect(ref param); GameObject splineMeshGO = m_SplineMesh.gameObject; ResNode.DestroyRes(ref splineMeshGO); m_MainHeroTrans = null; m_SplineMesh = null; m_Prefab = null; }
private void deleteComponent(Transform node) { foreach (Component comp in node.gameObject.GetComponents <Component>()) { if (comp != node.transform) { Component temp = comp; ResNode.DestroyRes(ref temp); } } }
public static void ClearTestModel() { foreach (GameObject go in m_TestModelList) { if (go) { GameObject temp = go; ResNode.DestroyRes(ref temp); } } }
public void showOftenUseHeroInfo(List <cmd_entity_hero_info> heroInfoList) { if (heroInfoList.Count > 5 || heroReqRes == null) { return; } // 在创建预制体之前,先把group内的东西清空 int nChildCount = heroGroup.transform.childCount; for (int i = 0; i < nChildCount; i++) { GameObject go = heroGroup.transform.GetChild(0).gameObject; ResNode.DestroyRes(ref go); } bool bIsFirst = true; int nMaxUseTime = 0; // dicHeroInfo接收的经常使用的英雄是按照使用英雄的次数进行排序的 foreach (cmd_entity_hero_info item in heroInfoList) { if (item.nHeroID == 0) { continue; } // 可以先打开游戏看一下像经验条一样,我要先确定最大经验, 即英雄使用做多的次数 if (bIsFirst) { nMaxUseTime = item.nGameCount; bIsFirst = false; } // 创建预制体并进行赋值显示 GameObject instance = heroReqRes.InstanceMainRes(); instance.name = heroReqRes.AssetName; if (instance == null) { continue; } instance.transform.SetParent(heroGroup.transform, false); HeroInfo heroInfo = instance.GetComponent <HeroInfo>(); if (heroInfo == null) { continue; } bool bReqSelf = LogicDataCenter.playerSystemDataManager.bRequestSelf; int nReqID = LogicDataCenter.playerSystemDataManager.nRequestPDBID; heroInfo.setRequestInfo(bReqSelf, nReqID); heroInfo.setHeroInfo(item, nMaxUseTime); } }
/// <summary> /// 删除动态添加的脚本 /// </summary> private void DestroyDynamicCommopnent() { if (m_DynamicCommopnent.Count > 0) { foreach (MonoBehaviour mb in m_DynamicCommopnent) { var temp = mb; ResNode.DestroyRes(ref temp); } m_DynamicCommopnent.Clear(); } }
public void onAddBlackListByOther(int dwUserID) { // 如果有该窗口,则销毁该窗口 GameObject subChatWndObj; string sessionName = LogicDataCenter.snsDataManager.getSessionName(dwUserID); if (m_subChatWndList.TryGetValue(sessionName, out subChatWndObj)) { LogicDataCenter.snsDataManager.SessionManager.delSession(sessionName); m_subChatWndList.Remove(sessionName); ResNode.DestroyRes(ref subChatWndObj); } }
/// <summary> /// 删除子节点 /// </summary> /// <param name="parent"></param> public static void DestroyChild(Transform parent) { if (parent == null) { return; } for (int i = parent.childCount - 1; i >= 0; --i) { GameObject go = parent.GetChild(i).gameObject; ResNode.DestroyRes(ref go); } }
public static void Clear() { if (MonoInstance) { inputInstance.StopAllCoroutines(); inputInstance = null; ResNode.DestroyRes(ref MonoInstance); MonoInstance = null; //AllKeyEnums.Clear(); //AllKeyEnums = null; } InputConvertHelper.Clear(); }
public void ForceDeleteTestModel() { if (EffectNode.UseTestModel) { matInstances.Clear(); m_Renders.Clear(); if (TestModel) { ResNode.DestroyRes(ref TestModel); } return; } }
protected void ReleaseRTCamera(UEffectNode _nodeRegister) { var _node = _nodeRegister.To <UEffectNodeData_Mesh>(); if (_nodeRegister.EffectType == UEffectType.UET_EffectMesh && _node != null) { RemoveAndSortCamera(_node.EffectMeshCamera.Camera); m_MeshEffectCount--; var temp = _node.EffectMeshCamera.Camera.gameObject; ResNode.DestroyRes(ref temp); _node.EffectMeshCamera.Camera = null; } }
public void UpdateLastEnterDistrictList() { int nCount = LastEnterServerList.transform.childCount; for (int i = nCount - 1; i >= 0; --i) { Transform childTrans = LastEnterServerList.transform.GetChild(i); if (childTrans) { GameObject go = childTrans.gameObject; // 销毁obj ResNode.DestroyRes(ref go); } } m_lastEnterDistrictList = DataCenter.LogicDataCenter.districtListDataManger.LastEnterDistrictInfoList; if (m_lastEnterDistrictList == null || m_lastEnterDistrictList.Count < 1) { return; } for (int i = 0; i < m_lastEnterDistrictList.Count; i++) { //最多列5个 if (i > 5) { break; } GameObject serverGo = ResNode.InstantiateRes(DefaultLastServerItem); if (serverGo != null) { serverGo.transform.SetParent(LastEnterServerList.transform, false); serverGo.GetComponent <UButtonGroupItem>().Group = LastEnterServerList; serverGo.SetActive(true); Text btnLabel = serverGo.GetComponentInChildren <Text>(); if (btnLabel) { btnLabel.text = m_lastEnterDistrictList[i].szName; } DistrictInfo districtInfo = serverGo.GetComponent <DistrictInfo>(); if (districtInfo != null) { districtInfo.SetData(i, m_lastEnterDistrictList[i].nGroup, m_lastEnterDistrictList[i].nDistrict, m_lastEnterDistrictList[i].nServer); } } } }
// 设置经常使用英雄信息 private void SetOftenUseHeroInfo(List <cmd_entity_hero_info> heroInfoList, GameObject heroGroup, ResNode heroIns, int nPDBID, bool bIsSelf) { if (heroInfoList.Count > 5 || heroIns == null) { return; } // 每次先清空HeroGroup内容 int nChildCount = heroGroup.transform.childCount; for (int i = nChildCount - 1; i >= 0; --i) { GameObject go = heroGroup.transform.GetChild(i).gameObject; ResNode.DestroyRes(ref go); } bool bIsFirst = true; int nMaxUseNum = 0; // heroInfoList数据是按使用次数从大向小排序的 foreach (var item in heroInfoList) { if (item.nHeroID == 0) { return; } // 确定最大使用次数 if (bIsFirst) { bIsFirst = false; nMaxUseNum = item.nGameCount; } // 创建预制体并进行赋值显示 GameObject inst = heroIns.InstanceMainRes(); if (inst == null) { continue; } inst.transform.SetParent(heroGroup.transform, false); HeroInfo heroInfo = inst.GetComponent <HeroInfo>(); if (heroInfo == null) { continue; } heroInfo.setRequestInfo(bIsSelf, nPDBID); heroInfo.setHeroInfo(item, nMaxUseNum); } }