public override void UpdateLogic(int delta) { if (this.soulSuckObjList.get_Count() == 0) { return; } int i = 0; while (i < this.soulSuckObjList.get_Count()) { DuraEftPlayParam duraEftPlayParam = this.soulSuckObjList.get_Item(i); if (this.UpdateSuckSoulEftMove(ref duraEftPlayParam, delta)) { Singleton <CGameObjectPool> .GetInstance().RecycleGameObject(duraEftPlayParam.EftObj); this.soulSuckObjList.RemoveAt(i); this.PlayHunHurtEft(); } else { this.soulSuckObjList.set_Item(i, duraEftPlayParam); i++; } } }
private void ClearVariables() { this.m_skillGestureGuide = null; this.m_kingOfKillerEff = null; for (int i = 0; i < this.soulSuckObjList.Count; i++) { DuraEftPlayParam param = this.soulSuckObjList[i]; Singleton <CGameObjectPool> .GetInstance().RecycleGameObject(param.EftObj); } this.soulSuckObjList.Clear(); }
private bool UpdateSuckSoulEftMove(ref DuraEftPlayParam eftParam, int delta) { Vector3 position = this.actor.myTransform.position; position.y += (float)this.actor.CharInfo.iBulletHeight * 0.001f; if (eftParam.EftObj == null) { return(true); } Vector3 position2 = eftParam.EftObj.transform.position; eftParam.EftObj.transform.position = Vector3.Slerp(position2, position, (float)delta / (float)eftParam.RemainMSec); eftParam.RemainMSec -= delta; return(eftParam.RemainMSec <= 0); }
private bool UpdateSuckSoulEftMove(ref DuraEftPlayParam eftParam, int delta) { Vector3 position = base.actor.gameObject.transform.position; position.y += base.actor.CharInfo.iBulletHeight * 0.001f; if (eftParam.EftObj == null) { return(true); } Vector3 from = eftParam.EftObj.transform.position; eftParam.EftObj.transform.position = Vector3.Slerp(from, position, ((float)delta) / ((float)eftParam.RemainMSec)); eftParam.RemainMSec -= delta; return(eftParam.RemainMSec <= 0); }
public void PlaySuckSoulEft(PoolObjHandle <ActorRoot> src) { if ((src != 0) && ((ActorHelper.IsCaptainActor(ref this.actorPtr) && base.actor.Visible) && base.actor.InCamera)) { float z = src.handle.CharInfo.iBulletHeight * 0.001f; Vector3 pos = src.handle.gameObject.transform.localToWorldMatrix.MultiplyPoint(new Vector3(0f, 0f, z)); Quaternion rot = Quaternion.Euler(-90f, 0f, 0f); GameObject obj2 = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(s_heroSuckEftPath, true, SceneObjType.ActionRes, pos, rot); if (obj2 != null) { DuraEftPlayParam item = new DuraEftPlayParam { EftObj = obj2, RemainMSec = s_suckSoulMSec }; this.soulSuckObjList.Add(item); } } }
public void PlaySuckSoulEft(PoolObjHandle <ActorRoot> src) { if (!src) { return; } if (!ActorHelper.IsCaptainActor(ref this.actorPtr) || !this.actor.Visible || !this.actor.InCamera) { return; } float z = (float)src.handle.CharInfo.iBulletHeight * 0.001f; Vector3 pos = src.handle.myTransform.localToWorldMatrix.MultiplyPoint(new Vector3(0f, 0f, z)); Quaternion rot = Quaternion.Euler(-90f, 0f, 0f); GameObject pooledGameObjLOD = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(EffectPlayComponent.s_heroSuckEftPath, true, SceneObjType.ActionRes, pos, rot); if (pooledGameObjLOD != null) { DuraEftPlayParam duraEftPlayParam = default(DuraEftPlayParam); duraEftPlayParam.EftObj = pooledGameObjLOD; duraEftPlayParam.RemainMSec = EffectPlayComponent.s_suckSoulMSec; this.soulSuckObjList.Add(duraEftPlayParam); } }
public override void UpdateLogic(int delta) { if (this.soulSuckObjList.Count != 0) { int index = 0; while (index < this.soulSuckObjList.Count) { DuraEftPlayParam eftParam = this.soulSuckObjList[index]; if (this.UpdateSuckSoulEftMove(ref eftParam, delta)) { Singleton <CGameObjectPool> .GetInstance().RecycleGameObject(eftParam.EftObj); this.soulSuckObjList.RemoveAt(index); this.PlayHunHurtEft(); } else { this.soulSuckObjList[index] = eftParam; index++; } } } }