public override object DoSpawn(VInt3 inWorldPos, VInt3 inDir, GameObject inSpawnPoint) { CTailsman cTailsman = ClassObjPool <CTailsman> .Get(); cTailsman.Init(this.TailsmanId, inWorldPos, this.SrcActorCond); return(cTailsman); }
public void Init(int inConfigId, VInt3 inWorldPos, STriggerCondActor[] inSrcActorCond) { this.ConfigId = inConfigId; this.InitLoc = inWorldPos; this.CharmId = CTailsman.ExtractCharmIdFromLib(this.ConfigId); ShenFuInfo dataByKey = GameDataMgr.shenfuBin.GetDataByKey((long)this.CharmId); if (dataByKey == null) { return; } 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 sTailsmanEventParam = new STailsmanEventParam(inTailsman, new PoolObjHandle <ActorRoot>(null)); Singleton <GameEventSys> .instance.SendEvent <STailsmanEventParam>(GameEventDef.Event_TailsmanSpawn, ref sTailsmanEventParam); }