public void PreLoadResource(ref ActorPreloadTab loadInfo, LoaderHelper loadHelper) { if (this.SpawnType == ESpawnObjectType.Tailsman) { CharmLib dataByKey = GameDataMgr.charmLib.GetDataByKey((long)this.ConfigId); if (dataByKey != null) { for (int i = 0; i < 10; i++) { if (dataByKey.astCharmId[i].iParam == 0) { break; } int iParam = dataByKey.astCharmId[i].iParam; ShenFuInfo info = GameDataMgr.shenfuBin.GetDataByKey((long)iParam); if (info != null) { AssetLoadBase item = new AssetLoadBase { assetPath = StringHelper.UTF8BytesToString(ref info.szShenFuResPath) }; loadInfo.mesPrefabs.Add(item); loadHelper.AnalyseSkillCombine(ref loadInfo, info.iBufId); } } } } }
public void OnShenfuStart(uint shenFuId, AreaEventTrigger trigger, TriggerActionShenFu shenFu) { if ((trigger != null) && (shenFu != null)) { ShenFuObjects objects = new ShenFuObjects(); if (this._shenFuTriggerPool.ContainsKey(trigger.ID)) { this._shenFuTriggerPool.TryGetValue(trigger.ID, out objects); } else { ShenFuInfo dataByKey = GameDataMgr.shenfuBin.GetDataByKey(shenFuId); if (dataByKey == null) { return; } trigger.Radius = (int)dataByKey.dwGetRadius; string prefabName = StringHelper.UTF8BytesToString(ref dataByKey.szShenFuResPath); objects.ShenFu = MonoSingleton <SceneMgr> .instance.InstantiateLOD(prefabName, false, SceneObjType.ActionRes, trigger.gameObject.transform.position); this._shenFuTriggerPool.Add(trigger.ID, objects); } if (objects.ShenFu != null) { objects.ShenFu.CustomSetActive(true); } } }
public void Init(int inConfigId, VInt3 inWorldPos, STriggerCondActor[] inSrcActorCond) { this.ConfigId = inConfigId; this.InitLoc = inWorldPos; this.CharmId = ExtractCharmIdFromLib(this.ConfigId); ShenFuInfo dataByKey = GameDataMgr.shenfuBin.GetDataByKey(this.CharmId); if (dataByKey != null) { this.EffectRadius = (int)dataByKey.dwGetRadius; string prefabName = StringHelper.UTF8BytesToString(ref dataByKey.szShenFuResPath); this.Presentation = MonoSingleton <SceneMgr> .instance.InstantiateLOD(prefabName, false, SceneObjType.ActionRes, (Vector3)inWorldPos); if (this.Presentation != null) { this.Presentation.CustomSetActive(true); } if (inSrcActorCond == null) { this.SrcActorCond = null; } else { this.SrcActorCond = inSrcActorCond.Clone() as STriggerCondActor[]; } Singleton <ShenFuSystem> .instance.AddCharm(new PoolObjHandle <CTailsman>(this)); PoolObjHandle <CTailsman> inTailsman = new PoolObjHandle <CTailsman>(this); STailsmanEventParam prm = new STailsmanEventParam(inTailsman, new PoolObjHandle <ActorRoot>(null)); Singleton <GameEventSys> .instance.SendEvent <STailsmanEventParam>(GameEventDef.Event_TailsmanSpawn, ref prm); } }
public void OnShenfuStart(uint shenFuId, AreaEventTrigger trigger, TriggerActionShenFu shenFu) { if (trigger == null || shenFu == null) { return; } ShenFuObjects shenFuObjects = default(ShenFuObjects); ShenFuInfo dataByKey = GameDataMgr.shenfuBin.GetDataByKey(shenFuId); if (dataByKey == null) { return; } trigger.Radius = (int)dataByKey.dwGetRadius; string prefabName = StringHelper.UTF8BytesToString(ref dataByKey.szShenFuResPath); shenFuObjects.ShenFu = MonoSingleton <SceneMgr> .get_instance().InstantiateLOD(prefabName, false, SceneObjType.ActionRes, trigger.gameObject.transform.position); this._shenFuTriggerPool.Add(trigger.ID, shenFuObjects); if (FogOfWar.enable) { COM_PLAYERCAMP playerCamp = Singleton <GamePlayerCenter> .get_instance().GetHostPlayer().PlayerCamp; GameFowCollector.SetObjVisibleByFow(shenFuObjects.ShenFu, Singleton <GameFowManager> .get_instance(), playerCamp); } }
public void OnShenFuEffect(PoolObjHandle <ActorRoot> actor, uint shenFuId) { ShenFuInfo dataByKey = GameDataMgr.shenfuBin.GetDataByKey(shenFuId); if (dataByKey == null) { return; } BufConsumer bufConsumer = new BufConsumer(dataByKey.iBufId, actor, actor); if (bufConsumer.Use()) { } }
public void PreLoadResource(TriggerActionWrapper triggerActionWrapper, ref ActorPreloadTab loadInfo, LoaderHelper loadHelper) { if (triggerActionWrapper != null) { ShenFuInfo dataByKey = GameDataMgr.shenfuBin.GetDataByKey((long)triggerActionWrapper.UpdateUniqueId); if (dataByKey != null) { AssetLoadBase item = new AssetLoadBase { assetPath = StringHelper.UTF8BytesToString(ref dataByKey.szShenFuResPath) }; loadInfo.mesPrefabs.Add(item); loadHelper.AnalyseSkillCombine(ref loadInfo, dataByKey.iBufId); } } }
public static void PreLoadShenfuResource(int shenfuId, ref ActorPreloadTab loadInfo, LoaderHelper loadHelper) { ShenFuInfo dataByKey = GameDataMgr.shenfuBin.GetDataByKey((long)shenfuId); if (dataByKey == null) { return; } AssetLoadBase assetLoadBase = new AssetLoadBase { assetPath = StringHelper.UTF8BytesToString(ref dataByKey.szShenFuResPath) }; loadInfo.mesPrefabs.Add(assetLoadBase); loadHelper.AnalyseSkillCombine(ref loadInfo, dataByKey.iBufId); }
public void OnShenFuEffect(PoolObjHandle <ActorRoot> actor, uint shenFuId, AreaEventTrigger trigger, TriggerActionShenFu shenFu) { ShenFuObjects objects; if (this._shenFuTriggerPool.TryGetValue(trigger.ID, out objects) && (objects.ShenFu != null)) { objects.ShenFu.CustomSetActive(false); } ShenFuInfo dataByKey = GameDataMgr.shenfuBin.GetDataByKey(shenFuId); if (dataByKey != null) { BufConsumer consumer = new BufConsumer(dataByKey.iBufId, actor, actor); if (consumer.Use()) { } } }
public void OnShenfuStart(uint shenFuId, AreaEventTrigger trigger, TriggerActionShenFu shenFu) { if (trigger == null || shenFu == null) { return; } ShenFuInfo dataByKey = GameDataMgr.shenfuBin.GetDataByKey(shenFuId); if (dataByKey == null) { return; } trigger.Radius = (int)dataByKey.dwGetRadius; ShenFuObjects shenFuObjects = default(ShenFuObjects); if (this.CreateShenFu(shenFuId, trigger.gameObject.transform.position, ref shenFuObjects, 0)) { this._shenFuTriggerPool.Add(trigger.ID, shenFuObjects); } }
private void SetMyselfOnFire(PoolObjHandle <ActorRoot> inActor) { if (inActor != 0) { if (this.CharmId > 0) { ShenFuInfo dataByKey = GameDataMgr.shenfuBin.GetDataByKey(this.CharmId); if (dataByKey != null) { BufConsumer consumer = new BufConsumer(dataByKey.iBufId, inActor, inActor); if (consumer.Use()) { PoolObjHandle <CTailsman> inTailsman = new PoolObjHandle <CTailsman>(this); STailsmanEventParam prm = new STailsmanEventParam(inTailsman, inActor); Singleton <GameEventSys> .instance.SendEvent <STailsmanEventParam>(GameEventDef.Event_TailsmanUsed, ref prm); } } } this.DoClearing(); } }
public void OnShenFuEffect(PoolObjHandle <ActorRoot> actor, uint shenFuId, AreaEventTrigger trigger, TriggerActionShenFu shenFu) { ShenFuObjects objects; if (this._shenFuTriggerPool.TryGetValue(trigger.ID, out objects)) { if (objects.ShenFu != null) { Singleton <CGameObjectPool> .GetInstance().RecycleGameObject(objects.ShenFu); } this._shenFuTriggerPool.Remove(trigger.ID); } ShenFuInfo dataByKey = GameDataMgr.shenfuBin.GetDataByKey(shenFuId); if (dataByKey != null) { BufConsumer consumer = new BufConsumer(dataByKey.iBufId, actor, actor); if (consumer.Use()) { } } }
public bool CreateShenFu(uint shenFuId, Vector3 createPosition, ref ShenFuObjects shenFuObj, int pickTick = 0) { ShenFuInfo dataByKey = GameDataMgr.shenfuBin.GetDataByKey(shenFuId); if (dataByKey == null) { return(false); } string prefabName = StringHelper.UTF8BytesToString(ref dataByKey.szShenFuResPath); shenFuObj.ShenFuId = shenFuId; shenFuObj.ShenFu = MonoSingleton <SceneMgr> .instance.InstantiateLOD(prefabName, false, SceneObjType.ActionRes, createPosition); shenFuObj.PickUpRange = dataByKey.dwGetRadius; shenFuObj.PickTick = pickTick; if (FogOfWar.enable) { COM_PLAYERCAMP horizonCamp = Singleton <WatchController> .instance.HorizonCamp; GameFowCollector.SetObjVisibleByFow(new PoolObjHandle <ActorRoot>(null), shenFuObj.ShenFu, Singleton <GameFowManager> .instance, horizonCamp); } return(true); }