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); } }
private void onTailsmanUsed(ref STailsmanEventParam prm) { int count = this.m_spawnedList.Count; this.m_spawnedList.Remove(prm.tailsman.handle); int num2 = this.m_spawnedList.Count; if ((num2 == 0) && (num2 < count)) { this.onMyselfAllDead(); } }
private void onTailsmanUsed(ref STailsmanEventParam prm) { int count = this.m_spawnedList.get_Count(); this.m_spawnedList.Remove(prm.tailsman.handle); int count2 = this.m_spawnedList.get_Count(); if (count2 == 0 && count2 < count) { this.onMyselfAllDead(); } }
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(); } }