protected override void OnUpdate() { float frameDistance = 0f; if ((Updater.AliveTime - this.currenttime) < this.move1time) { frameDistance = base.FrameDistance; } else if ((Updater.AliveTime - this.currenttime) >= this.waittime) { frameDistance = base.FrameDistance; if (!this.bFind) { this.mTarget = GameLogic.Release.Entity.GetNearEntity(this, false); this.bFind = true; } if ((this.mTarget != null) && !this.mTarget.GetIsDead()) { float x = this.mTarget.position.x - base.mTransform.position.x; float y = this.mTarget.position.z - base.mTransform.position.z; float target = Utils.getAngle(x, y); float current = base.mTransform.eulerAngles.y; float num6 = MathDxx.MoveTowardsAngle(current, target, this.perangle); float num7 = MathDxx.Abs((float)(current - num6)); float num8 = MathDxx.Abs((float)((current - num6) + 360f)); float num9 = MathDxx.Abs((float)((current - num6) - 360f)); if (num7 > num8) { num7 = num8; } if (num7 > num9) { num7 = num9; } this.currentrotateangle += num7; base.bulletAngle = num6; base.UpdateMoveDirection(); } } base.mTransform.position += new Vector3(base.moveX, 0f, base.moveY * 1.23f) * frameDistance; base.CurrentDistance += frameDistance; if (base.CurrentDistance >= base.Distance) { this.overDistance(); } }
public virtual void UpdateProgress() { if ((this.CanRotate && (((this.m_EntityHero != null) && !this.m_EntityHero.GetIsDead()) && !this.m_EntityHero.m_EntityData.IsDizzy())) && ((this.m_EntityHero.m_EntityData != null) && (this.m_EntityHero.m_EntityData.attribute != null))) { this.pAliveTime = Updater.AliveTime; this.updateangley = MathDxx.MoveTowardsAngle(this.updateangley, this.RotateAngle, this.m_EntityHero.m_EntityData.attribute.RotateSpeed.Value * Updater.delta); if (this.m_EntityHero.Child != null) { this.m_EntityHero.Child.transform.localRotation = Quaternion.Euler(0f, this.updateangley, 0f); this.m_EntityHero.SetEulerAngles(this.m_EntityHero.Child.transform.eulerAngles); if (this.m_EntitySelf != null) { this.m_EntitySelf.Coin_Absorb.localRotation = this.m_EntityHero.Child.transform.localRotation; } } if (this.mBomberman != null) { this.mBomberman.Update(); } } }
protected override void OnUpdate() { float frameDistance = base.FrameDistance; float x = this.endpos.x - base.mTransform.position.x; float y = this.endpos.z - base.mTransform.position.z; float target = Utils.getAngle(x, y); float bulletAngle = base.bulletAngle; this.perangle++; if (this.currentrotateangle < this.maxangle) { float num6 = MathDxx.MoveTowardsAngle(bulletAngle, target, this.perangle); if (num6 == target) { this.currentrotateangle = 2.147484E+09f; } float num7 = MathDxx.Abs((float)(bulletAngle - num6)); float num8 = MathDxx.Abs((float)((bulletAngle - num6) + 360f)); float num9 = MathDxx.Abs((float)((bulletAngle - num6) - 360f)); if (num7 > num8) { num7 = num8; } if (num7 > num9) { num7 = num9; } this.currentrotateangle += num7; base.bulletAngle = num6; base.UpdateMoveDirection(); } base.mTransform.position += new Vector3(base.moveX, 0f, base.moveY * 1.23f) * frameDistance; base.CurrentDistance += frameDistance; if (base.CurrentDistance >= base.Distance) { this.overDistance(); } }