示例#1
0
文件: Bio.cs 项目: niuniuzhu/Lockstep
        internal override void UpdateState(UpdateContext context)
        {
            this.time += context.deltaTime;

            this._regenTime += context.deltaTime;
            if (this._regenTime >= 5f)
            {
                this._regenTime -= 5f;
                if (!this.isDead)
                {
                    this.property.Add(Attr.Hp, this.property.hpRegen);
                    this.property.Add(Attr.Mana, this.property.manaRegen);
                }
            }

            this.UpdateThink(context);
            this.fsm.Update(context);

            for (int i = 0; i < this._numSkills; i++)
            {
                this.skills[i].Update(context.deltaTime);
            }

            int count = this._buffStates.Count;

            for (int i = 0; i < count; i++)
            {
                this._buffStates[i].Update(context);
            }

            count = this._buffStatesToDestroy.Count;
            if (count > 0)
            {
                for (int i = 0; i < count; i++)
                {
                    BSBase buffState = this._buffStatesToDestroy[i];
                    this.DestroyBuffStateImmediately(buffState);
                }
                this._buffStatesToDestroy.Clear();
            }

            this.UpdateSteering(context);

            this.sensorySystem.Update(context);

            if (this.debugDraw)
            {
                SyncEventHelper.DebugDraw(SyncEvent.DebugDrawType.WireCube, this.property.position + new Vec3(0, this.size.y * 0.5f, 0), this.size, null, 0, Color4.gray);
            }

            if (this.lifeTime > 0 &&
                this.time >= this.lifeTime)
            {
                this.markToDestroy = true;
            }
        }
示例#2
0
        internal virtual void UpdateState(UpdateContext context)
        {
            this.time += context.deltaTime;

            this.UpdateThink(context);
            this.UpdateSteering(context);

            if (this.debugDraw)
            {
                SyncEventHelper.DebugDraw(SyncEvent.DebugDrawType.WireCube, this.property.position + new Vec3(0, this.size.y * 0.5f, 0), this.size, null, 0, Color4.gray);
            }

            if (this.lifeTime > 0 &&
                this.time >= this.lifeTime)
            {
                this.markToDestroy = true;
            }
        }
示例#3
0
 private void DebugDrawForce(Vec3 force)
 {
     SyncEventHelper.DebugDraw(SyncEvent.DebugDrawType.Ray, this._behaviors.owner.property.position, force, null, 0f, Color4.yellow);
 }
示例#4
0
 private void DebugDrawDetectRadius(float detectRadius)
 {
     SyncEventHelper.DebugDraw(SyncEvent.DebugDrawType.WireSphere, this._behaviors.owner.property.position, Vec3.zero, null, detectRadius, Color4.blue);
 }
示例#5
0
 private void DebugDrawPath()
 {
     SyncEventHelper.DebugDraw(SyncEvent.DebugDrawType.Path, Vec3.zero, Vec3.zero, this.path.corners, 0, Color4.white);
 }