private void OnNextSpawnGroups(ref NextSpawnGroupsParam prm) { if (prm.OldGroup == null) { return; } for (int i = 0; i < this.node_ary.Count; i++) { DragonIcon.DragonNode dragonNode = this.node_ary[i]; if (dragonNode != null && dragonNode.spawnGroup == prm.OldGroup) { dragonNode.spawnGroup = prm.NextGroups[0]; } } ActorMeta actorMeta = prm.OldGroup.TheActorsMeta[0]; ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(actorMeta.ConfigId); if (dataCfgInfoByCurLevelDiff == null) { return; } if (dataCfgInfoByCurLevelDiff.bSoldierType == 9) { KillDetailInfo killDetailInfo = new KillDetailInfo(); killDetailInfo.bSelfCamp = true; killDetailInfo.Type = KillDetailInfoType.Info_Type_5V5SmallDragon_Suicide; Singleton <EventRouter> .instance.BroadCastEvent <KillDetailInfo>(EventID.AchievementRecorderEvent, killDetailInfo); KillDetailInfo killDetailInfo2 = new KillDetailInfo(); killDetailInfo2.bSelfCamp = true; killDetailInfo2.Type = KillDetailInfoType.Info_Type_5V5SmallDragon_Enter; Singleton <EventRouter> .instance.BroadCastEvent <KillDetailInfo>(EventID.AchievementRecorderEvent, killDetailInfo2); } }
public void BuildSoldierRegions(ref List <ActorPreloadTab> list) { SoldierRegion[] regionArray = UnityEngine.Object.FindObjectsOfType <SoldierRegion>(); if ((regionArray != null) && (regionArray.Length != 0)) { for (int i = 0; i < regionArray.Length; i++) { SoldierRegion region = regionArray[i]; if (((region != null) && (region.Waves != null)) && (region.Waves.Count > 0)) { for (int j = 0; j < region.Waves.Count; j++) { Assets.Scripts.GameLogic.SoldierWave wave = region.Waves[j]; if (((wave != null) && (wave.WaveInfo != null)) && ((wave.WaveInfo.astNormalSoldierInfo != null) && (wave.WaveInfo.astNormalSoldierInfo.Length > 0))) { for (int k = 0; k < wave.WaveInfo.astNormalSoldierInfo.Length; k++) { ResSoldierTypeInfo info = wave.WaveInfo.astNormalSoldierInfo[k]; if (info.dwSoldierID == 0) { break; } ActorMeta actorMeta = new ActorMeta { ActorType = ActorTypeDef.Actor_Type_Monster, ConfigId = (int)info.dwSoldierID }; this.AddPreloadActor(ref list, ref actorMeta, info.dwSoldierNum * 2f, 0); } } } } } } }
private void CheckOrganSoldierWave(ref List <ActorPreloadTab> InPreloadListRef, ref ActorMeta InOrganActorMetaRef, ActorStaticData InStaticData) { if (InOrganActorMetaRef.ActorType == ActorTypeDef.Actor_Type_Organ && InStaticData.TheOrganOnlyInfo.DeadEnemySoldier > 0) { ResSoldierWaveInfo dataByKey = GameDataMgr.soldierWaveDatabin.GetDataByKey((uint)InStaticData.TheOrganOnlyInfo.DeadEnemySoldier); int num = 0; while (dataByKey != null && ++num < 100) { for (int i = 0; i < dataByKey.astNormalSoldierInfo.Length; i++) { ResSoldierTypeInfo resSoldierTypeInfo = dataByKey.astNormalSoldierInfo[i]; if (resSoldierTypeInfo.dwSoldierID == 0u) { break; } ActorMeta actorMeta = default(ActorMeta); ActorMeta actorMeta2 = actorMeta; actorMeta2.ActorType = ActorTypeDef.Actor_Type_Monster; actorMeta2.ConfigId = (int)resSoldierTypeInfo.dwSoldierID; actorMeta = actorMeta2; this.AddPreloadActor(ref InPreloadListRef, ref actorMeta, 2f, 0); } dataByKey = GameDataMgr.soldierWaveDatabin.GetDataByKey(dataByKey.dwNextSoldierWaveID); } } }
public static PoolObjHandle <ActorRoot> AttachActorRoot(GameObject go, ActorTypeDef actorType, bool isFirstTime = true) { DebugHelper.Assert(!Singleton <BattleLogic> .instance.isFighting || Singleton <GameLogic> .instance.bInLogicTick); ActorConfig component = null; if (isFirstTime) { component = go.AddComponent <ActorConfig>(); } else { component = go.GetComponent <ActorConfig>(); if (null == component) { component = go.AddComponent <ActorConfig>(); } } ActorMeta theActorMeta = new ActorMeta { ActorType = actorType }; PoolObjHandle <ActorRoot> handle = component.AttachActorRoot(go, ref theActorMeta, null); handle.handle.Spawned(); return(handle); }
public void Init(GameObject mmNode_ugui, GameObject bmNode_ugui, GameObject mmNode_3dui, GameObject bmNode_3dui, bool b5V5) { this.m_b5v5 = b5V5; Singleton <EventRouter> .GetInstance().AddEventHandler <ActorRoot>("Dragon_born", new Action <ActorRoot>(this.onDragon_Born)); Singleton <EventRouter> .GetInstance().AddEventHandler <ActorRoot>("Dragon_dead", new Action <ActorRoot>(this.onDragon_Dead)); Singleton <GameEventSys> .instance.AddEventHandler <NextSpawnGroupsParam>(GameEventDef.Event_NextSpawnGroups, new RefAction <NextSpawnGroupsParam>(this.OnNextSpawnGroups)); for (int i = 0; i < mmNode_ugui.transform.childCount; i++) { mmNode_ugui.transform.GetChild(i).gameObject.CustomSetActive(false); } for (int j = 0; j < bmNode_ugui.transform.childCount; j++) { bmNode_ugui.transform.GetChild(j).gameObject.CustomSetActive(false); } for (int k = 0; k < mmNode_3dui.transform.childCount; k++) { mmNode_3dui.transform.GetChild(k).gameObject.CustomSetActive(false); } for (int l = 0; l < bmNode_3dui.transform.childCount; l++) { bmNode_3dui.transform.GetChild(l).gameObject.CustomSetActive(false); } this.node_ary.Add(new DragonIcon.DragonNode(mmNode_ugui, bmNode_ugui, mmNode_3dui, bmNode_3dui, "d_3", 7, 0)); this.node_ary.Add(new DragonIcon.DragonNode(mmNode_ugui, bmNode_ugui, mmNode_3dui, bmNode_3dui, "d_5_big", 8, 0)); this.node_ary.Add(new DragonIcon.DragonNode(mmNode_ugui, bmNode_ugui, mmNode_3dui, bmNode_3dui, "d_5_small_1", 9, 13)); this.node_ary.Add(new DragonIcon.DragonNode(mmNode_ugui, bmNode_ugui, mmNode_3dui, bmNode_3dui, "d_5_small_2", 9, 13)); ListView <SpawnGroup> spawnGroups = Singleton <BattleLogic> .instance.mapLogic.GetSpawnGroups(); if (spawnGroups != null) { for (int m = 0; m < spawnGroups.Count; m++) { SpawnGroup spawnGroup = spawnGroups[m]; if (spawnGroup != null) { ActorMeta actorMeta = spawnGroup.TheActorsMeta[0]; ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(actorMeta.ConfigId); if (dataCfgInfoByCurLevelDiff != null) { bool flag = dataCfgInfoByCurLevelDiff.bSoldierType == 8 || dataCfgInfoByCurLevelDiff.bSoldierType == 9 || dataCfgInfoByCurLevelDiff.bSoldierType == 7 || dataCfgInfoByCurLevelDiff.bSoldierType == 13; if (flag && !spawnGroup.bTriggerSpawn) { DragonIcon.DragonNode dragonNode = this.getDragonNode(dataCfgInfoByCurLevelDiff.bSoldierType); if (dragonNode != null) { dragonNode.spawnGroup = spawnGroup; dragonNode.SetData(spawnGroup.gameObject.transform.position, (int)dataCfgInfoByCurLevelDiff.bSoldierType, 0u, this.m_b5v5, true, true, true); dragonNode.ShowDead(true); MiniMapSysUT.RefreshMapPointerBig(dragonNode.bmDragonNode_3dui); } } } } } } this.m_cdTimer = Singleton <CTimerManager> .GetInstance().AddTimer(1000, 0, new CTimer.OnTimeUpHandler(this.OnCDTimer)); }
private static ActorMeta CreateActorMeta(DiaObject diaObject, ACD acd, int actorSNO, ActorType actorType) { using (new PerformanceLogger("CreateActorMeta")) { ActorMeta actorMeta; // We only care about having accurate information on Units and Gizmos. // Everything else can just return the default. //if (actorType == ActorType.Monster && diaObject is DiaUnit || // actorType == ActorType.Gizmo && diaObject is DiaGizmo || // actorType == ActorType.Player) //{ actorMeta = new ActorMeta(diaObject, acd, actorSNO, actorType); if (Trinity.Settings.Advanced.ExportNewActorMeta && actorMeta.IsValid && !actorMeta.IsPartial) { Logger.Log("Exporting ActorMeta for {0} ({1})", acd.Name, actorSNO); WriteToLog(actorMeta); } //} //else if (actorType == ActorType.Player) //{ // actorMeta = new ActorMeta(diaObject, acd, actorSNO, actorType); //} //else //{ // actorMeta = new ActorMeta(); //} ReferenceActorMeta.Add(actorSNO, actorMeta); return actorMeta; } }
private void AddActionsFromSpawnPoints(DictionaryView <string, AGE.Action> actions) { SpawnPoint[] pointArray = UnityEngine.Object.FindObjectsOfType <SpawnPoint>(); if ((pointArray != null) && (pointArray.Length != 0)) { for (int i = 0; i < pointArray.Length; i++) { SpawnPoint point = pointArray[i]; if ((point != null) && (point.TheActorsMeta.Length > 0)) { for (int j = 0; j < point.TheActorsMeta.Length; j++) { ActorMeta meta = point.TheActorsMeta[j]; if (meta.ConfigId > 0) { switch (meta.ActorType) { case ActorTypeDef.Actor_Type_Monster: this.AddActionsFromSoldier(actions, (uint)meta.ConfigId); break; } } } } } } }
public bool GetRevivePosDir(ref ActorMeta actorMeta, bool bGiveBirth, out VInt3 outPosWorld, out VInt3 outDirWorld) { outPosWorld = VInt3.zero; outDirWorld = VInt3.forward; if (Singleton <GamePlayerCenter> .get_instance().GetPlayer(actorMeta.PlayerId) == null) { return(false); } ListView <ReviveRegion> .Enumerator enumerator = this.reviveAreas.GetEnumerator(); while (enumerator.MoveNext()) { if (!(enumerator.get_Current() == null) && actorMeta.ActorCamp == enumerator.get_Current().CampType) { IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .get_instance().GetActorDataProvider(GameActorDataProviderType.ServerDataProvider); int num = actorDataProvider.Fast_GetActorServerDataBornIndex(ref actorMeta); Transform transform = enumerator.get_Current().transform; if (!bGiveBirth) { uint num2 = (uint)enumerator.get_Current().SubRevivePlaces.Length; if (!enumerator.get_Current().OnlyBirth) { num2 += 1u; int num3 = (int)FrameRandom.Random(num2); if (0 < num3 && enumerator.get_Current().SubRevivePlaces[num3 - 1] != null) { transform = enumerator.get_Current().SubRevivePlaces[num3 - 1].transform; } } else if (num2 >= 1u) { int num4 = (int)FrameRandom.Random(num2); if (enumerator.get_Current().SubRevivePlaces[num4] != null) { transform = enumerator.get_Current().SubRevivePlaces[num4].transform; } } } Transform transform2 = null; if (transform != null) { if (num < transform.childCount) { transform2 = transform.GetChild(num); } else { transform2 = transform; } } if (transform2 != null) { outPosWorld = (VInt3)transform2.position; outDirWorld = (VInt3)transform2.forward; return(true); } } } return(false); }
private void AddActionsFromSpawnPoints(DictionaryView <string, Action> actions) { SpawnPoint[] array = Object.FindObjectsOfType <SpawnPoint>(); if (array == null || array.Length == 0) { return; } for (int i = 0; i < array.Length; i++) { SpawnPoint spawnPoint = array[i]; if (spawnPoint != null && spawnPoint.TheActorsMeta.Length > 0) { for (int j = 0; j < spawnPoint.TheActorsMeta.Length; j++) { ActorMeta actorMeta = spawnPoint.TheActorsMeta[j]; if (actorMeta.ConfigId > 0) { ActorTypeDef actorType = actorMeta.ActorType; if (actorType == ActorTypeDef.Actor_Type_Monster) { this.AddActionsFromSoldier(actions, (uint)actorMeta.ConfigId); } } } } } }
public PoolObjHandle <ActorRoot> AttachActorRoot(GameObject rootObj, ref ActorMeta theActorMeta, CActorInfo actorInfo = null) { VInt num; DebugHelper.Assert(this.ActorObj == null); this.ActorObj = ClassObjPool <ActorRoot> .Get(); this.ActorPtr = new PoolObjHandle <ActorRoot>(this.ActorObj); this.ActorObj.ObjLinker = this; this.ActorObj.location = (VInt3)rootObj.transform.position; this.ActorObj.forward = (VInt3)rootObj.transform.forward; this.ActorObj.rotation = rootObj.transform.rotation; this.oldLocation = this.ActorObj.location; this.tarRotation = this.ActorObj.rotation; this.ActorObj.TheActorMeta = theActorMeta; if (theActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster) { this.ActorObj.TheActorMeta.EnCId = theActorMeta.ConfigId; } this.ActorObj.CharInfo = actorInfo; if (((this.ActorObj.TheActorMeta.ActorType < ActorTypeDef.Actor_Type_Bullet) && (this.ActorObj.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Organ)) && PathfindingUtility.GetGroundY(this.ActorObj, out num)) { this.ActorObj.groundY = num; VInt3 location = this.ActorObj.location; location.y = num.i; this.ActorObj.location = location; } return(this.ActorPtr); }
public void Init(ref ActorMeta actorMeta) { this.InitValueDataArr(ref actorMeta, false); IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .get_instance().GetActorDataProvider(GameActorDataProviderType.ServerDataProvider); ActorServerData actorServerData = default(ActorServerData); if (actorDataProvider.GetActorServerData(ref actorMeta, ref actorServerData)) { this.actorLvl = (int)actorServerData.Level; this.actorExp = (int)actorServerData.Exp; this.actorStar = (int)actorServerData.Star; this.actorQuality = (int)actorServerData.TheQualityInfo.Quality; this.actorSubQuality = (int)actorServerData.TheQualityInfo.SubQuality; } else { if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Monster) { IGameActorDataProvider actorDataProvider2 = Singleton <ActorDataCenter> .get_instance().GetActorDataProvider(GameActorDataProviderType.StaticBattleDataProvider); ActorStaticData actorStaticData = default(ActorStaticData); this.actorLvl = ((!actorDataProvider2.GetActorStaticData(ref actorMeta, ref actorStaticData)) ? 1 : actorStaticData.TheMonsterOnlyInfo.MonsterBaseLevel); } else { this.actorLvl = 1; } this.actorExp = 0; this.actorStar = 1; this.actorQuality = 1; this.actorSubQuality = 0; } }
private string GetMeshName(ref PoolObjHandle <ActorRoot> actor) { ActorMeta actorMeta = default(ActorMeta); ActorMeta actorMeta2 = actorMeta; actorMeta2.ConfigId = actor.handle.TheActorMeta.ConfigId; actorMeta2.ActorCamp = actor.handle.TheActorMeta.ActorCamp; actorMeta2.PlayerId = actor.handle.TheActorMeta.PlayerId; actorMeta = actorMeta2; ActorStaticData actorStaticData = default(ActorStaticData); IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.StaticBattleDataProvider); actorDataProvider.GetActorStaticData(ref actorMeta, ref actorStaticData); if (!string.IsNullOrEmpty(actorStaticData.TheResInfo.ResPath)) { CActorInfo actorInfo = CActorInfo.GetActorInfo(actorStaticData.TheResInfo.ResPath, enResourceType.BattleScene); if (actorInfo != null) { string artPrefabName = actorInfo.GetArtPrefabName((int)actorMeta.SkinID, -1); if (!string.IsNullOrEmpty(artPrefabName)) { return(artPrefabName); } } } return(string.Empty); }
private void CheckOrganSoldierWave(ref List <ActorPreloadTab> InPreloadListRef, ref ActorMeta InOrganActorMetaRef, ActorStaticData InStaticData) { if ((InOrganActorMetaRef.ActorType == ActorTypeDef.Actor_Type_Organ) && (InStaticData.TheOrganOnlyInfo.DeadEnemySoldier > 0)) { ResSoldierWaveInfo dataByKey = GameDataMgr.soldierWaveDatabin.GetDataByKey((uint)InStaticData.TheOrganOnlyInfo.DeadEnemySoldier); int num = 0; while ((dataByKey != null) && (++num < 100)) { for (int i = 0; i < dataByKey.astNormalSoldierInfo.Length; i++) { ResSoldierTypeInfo info2 = dataByKey.astNormalSoldierInfo[i]; if (info2.dwSoldierID == 0) { break; } ActorMeta actorMeta = new ActorMeta { ActorType = ActorTypeDef.Actor_Type_Monster, ConfigId = (int)info2.dwSoldierID }; this.AddPreloadActor(ref InPreloadListRef, ref actorMeta, 2f, 0); } dataByKey = GameDataMgr.soldierWaveDatabin.GetDataByKey(dataByKey.dwNextSoldierWaveID); } } }
public void BuildDynamicActor(ref List <ActorPreloadTab> list) { for (int i = 0; i < MonoSingleton <GameLoader> .instance.actorList.Count; i++) { ActorMeta actorMeta = MonoSingleton <GameLoader> .instance.actorList[i]; this.AddPreloadActor(ref list, ref actorMeta, 0f, 0); } }
public bool GetRevivePosDir(ref ActorMeta actorMeta, bool bGiveBirth, out VInt3 outPosWorld, out VInt3 outDirWorld) { outPosWorld = VInt3.zero; outDirWorld = VInt3.forward; if (Singleton <GamePlayerCenter> .instance.GetPlayer(actorMeta.PlayerId) != null) { ListView <ReviveRegion> .Enumerator enumerator = this.reviveAreas.GetEnumerator(); while (enumerator.MoveNext()) { if ((enumerator.Current != null) && (actorMeta.ActorCamp == enumerator.Current.CampType)) { int index = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.ServerDataProvider).Fast_GetActorServerDataBornIndex(ref actorMeta); Transform transform = enumerator.Current.transform; if (!bGiveBirth) { uint length = (uint)enumerator.Current.SubRevivePlaces.Length; if (!enumerator.Current.OnlyBirth) { length++; int num3 = FrameRandom.Random(length); if ((0 < num3) && (enumerator.Current.SubRevivePlaces[num3 - 1] != null)) { transform = enumerator.Current.SubRevivePlaces[num3 - 1].transform; } } else if (length >= 1) { int num4 = FrameRandom.Random(length); if (enumerator.Current.SubRevivePlaces[num4] != null) { transform = enumerator.Current.SubRevivePlaces[num4].transform; } } } Transform child = null; if (transform != null) { if (index < transform.childCount) { child = transform.GetChild(index); } else { child = transform; } } if (child != null) { outPosWorld = (VInt3)child.position; outDirWorld = (VInt3)child.forward; return(true); } } } } return(false); }
public override void OnUse() { base.OnUse(); this.name = string.Empty; this.isMovable = true; this.isRotatable = true; this.myTransform = null; this.ActorMesh = null; this.ActorMeshAnimation = null; this._bVisible = true; this._bInitVisibleDelay = 0; this._bInCamera = false; this.ObjID = 0u; this.TheActorMeta = default(ActorMeta); this.TheStaticData = default(ActorStaticData); this.SelfPtr.Release(); this.ObjLinker = null; this.ActorControl = null; this.ActorAgent = null; this.MovementComponent = null; this.SkillControl = null; this.ValueComponent = null; this.HurtControl = null; this.HudControl = null; this.AnimControl = null; this.BuffHolderComp = null; this.MatHurtEffect = null; this.ShadowEffect = null; this.EquipComponent = null; this.DefaultAttackModeControl = null; this.LockTargetAttackModeControl = null; this.PetControl = null; this.OriginalActorMesh = null; this.OriginalMeshAnim = null; this.shape = null; this.slotList.Clear(); this.bChildUpdate = false; this.SMNode = null; this._location = VInt3.zero; this._forward = VInt3.forward; this._rotation = Quaternion.identity; this.groundY = 0; this.hasReachedNavEdge = false; this.pickFlyY = 0; this.AttackOrderReady = true; this.bOneKiller = false; this.CharInfo = null; this.HorizonMarker = null; this.BornPos = VInt3.zero; this.isRecycled = false; this.BornPos = VInt3.zero; this.PositionRecords = null; this.PositionRecordsLastStamp = 0f; }
private void Calc9SlotHeroStandingPosition(CSDT_BATTLE_PLAYER_BRIEF stBattlePlayer) { Calc9SlotHeroData[] heroes = new Calc9SlotHeroData[3]; IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.StaticLobbyDataProvider); ActorStaticData actorData = new ActorStaticData(); ActorMeta actorMeta = new ActorMeta(); if (Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo() != null) { for (int i = 0; (i < stBattlePlayer.astFighter[0].astChoiceHero.Length) && (i < 3); i++) { uint dwHeroID = stBattlePlayer.astFighter[0].astChoiceHero[i].stBaseInfo.stCommonInfo.dwHeroID; if (dwHeroID != 0) { actorMeta.ConfigId = (int)dwHeroID; actorDataProvider.GetActorStaticData(ref actorMeta, ref actorData); heroes[i].Level = 1; heroes[i].Quality = 1; heroes[i].RecommendPos = actorData.TheHeroOnlyInfo.RecommendStandPos; heroes[i].Ability = (uint)CHeroDataFactory.CreateHeroData(dwHeroID).combatEft; heroes[i].ConfigId = dwHeroID; heroes[i].selected = false; heroes[i].BornIndex = -1; } } this.ImpCalc9SlotHeroStandingPosition(ref heroes); for (int j = 0; (j < stBattlePlayer.astFighter[0].astChoiceHero.Length) && (j < 3); j++) { stBattlePlayer.astFighter[0].astChoiceHero[j].stHeroExtral.iHeroPos = heroes[j].BornIndex; } for (int k = 0; (k < stBattlePlayer.astFighter[1].astChoiceHero.Length) && (k < 3); k++) { uint id = stBattlePlayer.astFighter[1].astChoiceHero[k].stBaseInfo.stCommonInfo.dwHeroID; if (id != 0) { actorMeta.ConfigId = (int)id; actorDataProvider.GetActorStaticData(ref actorMeta, ref actorData); heroes[k].Level = stBattlePlayer.astFighter[1].astChoiceHero[k].stBaseInfo.stCommonInfo.wLevel; heroes[k].Quality = stBattlePlayer.astFighter[1].astChoiceHero[k].stBaseInfo.stCommonInfo.stQuality.wQuality; heroes[k].RecommendPos = actorData.TheHeroOnlyInfo.RecommendStandPos; heroes[k].Ability = (uint)CHeroDataFactory.CreateHeroData(id).combatEft; heroes[k].ConfigId = id; heroes[k].selected = false; heroes[k].BornIndex = -1; } } this.ImpCalc9SlotHeroStandingPosition(ref heroes); for (int m = 0; (m < stBattlePlayer.astFighter[1].astChoiceHero.Length) && (m < 3); m++) { stBattlePlayer.astFighter[1].astChoiceHero[m].stHeroExtral.iHeroPos = heroes[m].BornIndex; } } }
public static string GetHero_Icon(ref ActorMeta actorMeta, bool bSmall = false) { string result = string.Empty; IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .get_instance().GetActorDataProvider(GameActorDataProviderType.ServerDataProvider); ActorServerData actorServerData = default(ActorServerData); if (actorDataProvider != null && actorDataProvider.GetActorServerData(ref actorMeta, ref actorServerData)) { result = KillNotifyUT.GetHero_Icon((uint)actorServerData.TheActorMeta.ConfigId, 0u, bSmall); } return(result); }
public override object DoSpawn(VInt3 inWorldPos, VInt3 inDir, GameObject inSpawnPoint) { List <PoolObjHandle <ActorRoot> > inSpawnedList = new List <PoolObjHandle <ActorRoot> >(); ActorMeta[] inActorMetaList = new ActorMeta[] { this.TheActorMeta }; SpawnPoint.DoSpawn(inSpawnPoint, inWorldPos, inDir, this.bSequentialMeta, inActorMetaList, this.m_rangePolygon, this.m_rangeDeadPoint, this.InitBuffDemand, this.InitRandPassSkillRule, ref inSpawnedList); if ((inSpawnedList.Count > 0) && (inSpawnedList[0] != 0)) { PoolObjHandle <ActorRoot> handle = inSpawnedList[0]; return(handle.handle); } return(null); }
public void Init(COMDT_HEROINFO svrInfo) { ActorMeta theActorMeta = new ActorMeta { ConfigId = (int)svrInfo.stCommonInfo.dwHeroID }; this.InitValueDataArr(ref theActorMeta, true); this.actorLvl = svrInfo.stCommonInfo.wLevel; this.actorExp = (int)svrInfo.stCommonInfo.dwExp; this.actorStar = svrInfo.stCommonInfo.wStar; this.actorQuality = svrInfo.stCommonInfo.stQuality.wQuality; this.actorSubQuality = svrInfo.stCommonInfo.stQuality.wSubQuality; this.SetSkinProp(svrInfo.stCommonInfo.dwHeroID, svrInfo.stCommonInfo.wSkinID, true); }
public void PreLoadResource(ref List <ActorPreloadTab> list, LoaderHelper loadHelper) { if (this.TheActorsMeta.Length > 0) { for (int i = 0; i < this.TheActorsMeta.Length; i++) { ActorMeta actorMeta = this.TheActorsMeta[i]; if (actorMeta.ConfigId > 0) { loadHelper.AddPreloadActor(ref list, ref actorMeta, 1f, 0); } } } }
/// <summary> /// Writes an ActorMeta record to the log file in the format for a Dictionary collection initializer /// </summary> public static void WriteToLog(ActorMeta meta) { if (ReferenceActorMeta.ContainsKey(meta.ActorSNO)) return; var logStream = File.Open(Path.Combine(FileManager.LoggingPath, "MonsterInfo.log"), FileMode.Append, FileAccess.Write, FileShare.Read); using (var logWriter = new StreamWriter(logStream)) { logWriter.WriteLine(meta.ToExportString()); } logStream.Close(); }
public void Init(GameObject node, GameObject bigNode, bool b5V5) { this.m_b5v5 = b5V5; Singleton <EventRouter> .GetInstance().AddEventHandler <ActorRoot>("Dragon_born", new Action <ActorRoot>(this.onDragon_Born)); Singleton <EventRouter> .GetInstance().AddEventHandler <ActorRoot>("Dragon_dead", new Action <ActorRoot>(this.onDragon_Dead)); for (int i = 0; i < node.transform.childCount; i++) { node.transform.GetChild(i).gameObject.CustomSetActive(false); } for (int j = 0; j < bigNode.transform.childCount; j++) { bigNode.transform.GetChild(j).gameObject.CustomSetActive(false); } this.node_ary.Add(new DragonNode(node, bigNode, "d_3", 7, 0)); this.node_ary.Add(new DragonNode(node, bigNode, "d_5_big", 8, 0)); this.node_ary.Add(new DragonNode(node, bigNode, "d_5_small_1", 9, 13)); this.node_ary.Add(new DragonNode(node, bigNode, "d_5_small_2", 9, 13)); SpawnGroup group = null; ListView <SpawnGroup> spawnGroups = Singleton <BattleLogic> .instance.mapLogic.GetSpawnGroups(); if (spawnGroups != null) { for (int k = 0; k < spawnGroups.Count; k++) { group = spawnGroups[k]; if ((group != null) && (group.NextGroups.Length == 0)) { ActorMeta meta = group.TheActorsMeta[0]; ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(meta.ConfigId); if ((dataCfgInfoByCurLevelDiff != null) && ((((dataCfgInfoByCurLevelDiff.bSoldierType == 8) || (dataCfgInfoByCurLevelDiff.bSoldierType == 9)) || (dataCfgInfoByCurLevelDiff.bSoldierType == 7)) || (dataCfgInfoByCurLevelDiff.bSoldierType == 13))) { DragonNode node2 = this.getDragonNode(dataCfgInfoByCurLevelDiff.bSoldierType); if (node2 != null) { node2.spawnGroup = group; node2.SetData(group.gameObject.transform.position, dataCfgInfoByCurLevelDiff.bSoldierType, 0, this.m_b5v5); node2.ShowDead(true); MiniMapSysUT.RefreshMapPointerBig(node2.node_in_bigMap); } } } } } if (Singleton <WatchController> .GetInstance().IsWatching) { this.m_cdTimer = Singleton <CTimerManager> .GetInstance().AddTimer(0x3e8, 0, new CTimer.OnTimeUpHandler(this.OnCDTimer)); } }
public override object DoSpawn(VInt3 inWorldPos, VInt3 inDir, GameObject inSpawnPoint) { List <PoolObjHandle <ActorRoot> > list = new List <PoolObjHandle <ActorRoot> >(); ActorMeta[] inActorMetaList = new ActorMeta[] { this.TheActorMeta }; SpawnPoint.DoSpawn(inSpawnPoint, inWorldPos, inDir, this.bSequentialMeta, inActorMetaList, this.m_rangePolygon, this.m_rangeDeadPoint, null, this.InitBuffDemand, this.InitRandPassSkillRule, ref list); if (list.get_Count() > 0 && list.get_Item(0)) { return(list.get_Item(0).handle); } return(null); }
public void Init(COMDT_HEROINFO svrInfo) { ActorMeta actorMeta = default(ActorMeta); ActorMeta actorMeta2 = actorMeta; actorMeta2.ConfigId = (int)svrInfo.stCommonInfo.dwHeroID; actorMeta = actorMeta2; this.InitValueDataArr(ref actorMeta, true); this.actorLvl = (int)svrInfo.stCommonInfo.wLevel; this.actorExp = (int)svrInfo.stCommonInfo.dwExp; this.actorStar = (int)svrInfo.stCommonInfo.wStar; this.actorQuality = (int)svrInfo.stCommonInfo.stQuality.wQuality; this.actorSubQuality = (int)svrInfo.stCommonInfo.stQuality.wSubQuality; this.SetSkinProp(svrInfo.stCommonInfo.dwHeroID, (uint)svrInfo.stCommonInfo.wSkinID, true); }
public void AddHero(uint heroCfgId) { if (heroCfgId == 0u || this._heroIds.Contains(heroCfgId)) { return; } if (this._heroIds.get_Count() >= 3) { DebugHelper.Assert(false, "已经给player添加了三个英雄但是还在尝试继续添加"); return; } this._heroIds.Add(heroCfgId); if (!this.Computer) { if (Singleton <GamePlayerCenter> .get_instance().HostPlayerId == this.PlayerId) { DebugHelper.CustomLog("Player {0} adds Hero {1}", new object[] { this.PlayerId, heroCfgId }); } } else if (string.IsNullOrEmpty(this.Name)) { ActorStaticData actorStaticData = default(ActorStaticData); ActorMeta actorMeta = default(ActorMeta); IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .get_instance().GetActorDataProvider(GameActorDataProviderType.StaticBattleDataProvider); actorMeta.PlayerId = this.PlayerId; actorMeta.ActorType = ActorTypeDef.Actor_Type_Hero; actorMeta.ConfigId = (int)heroCfgId; string text = (!actorDataProvider.GetActorStaticData(ref actorMeta, ref actorStaticData)) ? null : actorStaticData.TheResInfo.Name; this.Name = string.Format("{0}[{1}]", text, Singleton <CTextManager> .GetInstance().GetText("PVP_NPC")); } if (this._heroIds.get_Count() != 1) { return; } this.CaptainId = heroCfgId; if (Singleton <GamePlayerCenter> .get_instance().HostPlayerId == this.PlayerId) { DebugHelper.CustomLog("Set Captain ID {0}", new object[] { this.CaptainId }); } }
public void RefreshDragNode(bool bUseCache, bool bRefreshMM = false) { ListView <SpawnGroup> spawnGroups = Singleton <BattleLogic> .get_instance().mapLogic.GetSpawnGroups(); if (spawnGroups != null) { for (int i = 0; i < spawnGroups.get_Count(); i++) { SpawnGroup spawnGroup = spawnGroups.get_Item(i); if (spawnGroup != null && spawnGroup.NextGroups.Length == 0) { ActorMeta actorMeta = spawnGroup.TheActorsMeta[0]; ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(actorMeta.ConfigId); if (dataCfgInfoByCurLevelDiff != null) { bool flag = dataCfgInfoByCurLevelDiff.bSoldierType == 8 || dataCfgInfoByCurLevelDiff.bSoldierType == 9 || dataCfgInfoByCurLevelDiff.bSoldierType == 7 || dataCfgInfoByCurLevelDiff.bSoldierType == 13; if (flag) { DragonIcon.DragonNode dragonNode = this.getDragonNode(dataCfgInfoByCurLevelDiff.bSoldierType); if (dragonNode != null) { dragonNode.spawnGroup = spawnGroup; dragonNode.SetData(spawnGroup.gameObject.transform.position, (int)dataCfgInfoByCurLevelDiff.bSoldierType, dragonNode.objid, this.m_b5v5, bUseCache, false, bRefreshMM); if (dragonNode.objid != 0u) { PoolObjHandle <ActorRoot> actor = Singleton <GameObjMgr> .GetInstance().GetActor(dragonNode.objid); if (actor) { dragonNode.ShowDead(actor.get_handle().ActorControl.IsDeadState); } else { dragonNode.ShowDead(true); } } else { dragonNode.ShowDead(true); } MiniMapSysUT.RefreshMapPointerBig(dragonNode.bmDragonNode_3dui); } } } } } } }
private void SpawnMonster(Action _action) { ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(this.ConfigID); if (dataCfgInfoByCurLevelDiff == null) { return; } string fullPathInResources = StringHelper.UTF8BytesToString(ref dataCfgInfoByCurLevelDiff.szCharacterInfo) + ".asset"; CActorInfo exists = Singleton <CResourceManager> .GetInstance().GetResource(fullPathInResources, typeof(CActorInfo), enResourceType.BattleScene, false, false).m_content as CActorInfo; if (exists) { ActorMeta actorMeta = default(ActorMeta); ActorMeta actorMeta2 = actorMeta; actorMeta2.ConfigId = this.ConfigID; actorMeta2.ActorType = ActorTypeDef.Actor_Type_Monster; actorMeta2.ActorCamp = this.PlayerCamp; actorMeta2.EnCId = this.ConfigID; actorMeta = actorMeta2; VInt3 location = this.tarActor.handle.location; VInt3 forward = this.tarActor.handle.forward; PoolObjHandle <ActorRoot> poolObjHandle = Singleton <GameObjMgr> .GetInstance().SpawnActorEx(null, ref actorMeta, location, forward, false, true); if (poolObjHandle) { poolObjHandle.handle.InitActor(); poolObjHandle.handle.PrepareFight(); Singleton <GameObjMgr> .instance.AddActor(poolObjHandle); poolObjHandle.handle.StartFight(); poolObjHandle.handle.ObjLinker.Invincible = this.Invincible; poolObjHandle.handle.ObjLinker.CanMovable = this.Moveable; MonsterWrapper monsterWrapper = poolObjHandle.handle.ActorControl as MonsterWrapper; if (monsterWrapper != null) { if (this.wayPoint != null) { monsterWrapper.AttackAlongRoute(this.wayPoint.GetComponent <WaypointsHolder>()); } if (this.LifeTime > 0) { monsterWrapper.LifeTime = this.LifeTime; } } } } }
public static PoolObjHandle <ActorRoot> AttachActorRoot(GameObject go) { DebugHelper.Assert((!Singleton <BattleLogic> .instance.isFighting || Singleton <GameLogic> .instance.bInLogicTick) || Singleton <FrameSynchr> .instance.isCmdExecuting); ActorConfig component = go.GetComponent <ActorConfig>(); if (null == component) { component = go.AddComponent <ActorConfig>(); } ActorMeta theActorMeta = new ActorMeta { ActorType = ActorTypeDef.Invalid }; PoolObjHandle <ActorRoot> handle = component.AttachActorRoot(go, ref theActorMeta, null); handle.handle.Spawned(); return(handle); }
public int GetActorMarkID(ActorMeta actorMeta) { int skinCfgId = 0; IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.ServerDataProvider); ActorServerData actorData = new ActorServerData(); if ((actorDataProvider != null) && actorDataProvider.GetActorServerData(ref actorMeta, ref actorData)) { int skinId = (int)actorData.SkinId; if (skinId != 0) { skinCfgId = (int)CSkinInfo.GetSkinCfgId((uint)actorMeta.ConfigId, (uint)skinId); } } return(skinCfgId); }
public void BuildStaticActor(ref List <ActorPreloadTab> list) { DebugHelper.Assert(MonoSingleton <GameLoader> .instance.staticActors != null, "Static actors cannot be null"); for (int i = 0; i < MonoSingleton <GameLoader> .instance.staticActors.Count; i++) { object[] inParameters = new object[] { i }; DebugHelper.Assert(MonoSingleton <GameLoader> .instance.staticActors[i] != null, "actor config cannot be null at {0}", inParameters); if (MonoSingleton <GameLoader> .instance.staticActors[i] != null) { ActorMeta actorMeta = new ActorMeta { ActorType = MonoSingleton <GameLoader> .instance.staticActors[i].ActorType, ConfigId = MonoSingleton <GameLoader> .instance.staticActors[i].ConfigID, ActorCamp = MonoSingleton <GameLoader> .instance.staticActors[i].CmpType }; this.AddPreloadActor(ref list, ref actorMeta, 0f, 0); } } }
public bool TryGetFromCache(ref PoolObjHandle <ActorRoot> actor, ref ActorMeta actorMeta) { List <ActorRoot> list = null; if (!this.CachedActors.TryGetValue(actorMeta.ConfigId, ref list)) { return(false); } if (list.get_Count() == 0) { return(false); } int num = list.get_Count() - 1; actor = new PoolObjHandle <ActorRoot>(list.get_Item(num)); list.RemoveAt(num); return(true); }