Exemplo n.º 1
0
        public override void Tick(int deltaTimeMS)
        {
            if (!CouldRun())
            {
                return;
            }


            if (Math_F.Approximate3D(this.ownerEntity.position, this.tarPos) || IsPassed(this.tarPos))
            {
                //this.tarPos = Math_F.RandomInsideCircle(this.orgPos, this.radius);
                WanderArrived.Send(this.ownerEntity.entityID);
                return;
            }

            this.tickDir = Math_F.TwoPositionDir(this.ownerEntity.position, this.tarPos);

            ////活动移动量
            this.tickSpeed = this.speed * deltaTimeMS * 0.001f;
            //活动移动量
            this.tickMove = this.tickDir * this.tickSpeed;

            ////新位置
            this.ownerEntity.position += tickMove;
        }
 protected virtual void UnArrived(int deltaTimeMS, Vector3 target)
 {
     //向目的地走
     this.tickDir = Math_F.TwoPositionDir(this.ownerEntity.position, target);
     //活动移动量
     this.tickSpeed = this.speed * deltaTimeMS;
     this.tickMove  = this.tickDir * this.tickSpeed;
     //新位置
     this.ownerEntity.position += this.tickMove;
 }
Exemplo n.º 3
0
        protected void UnArrived(int deltaTimeMS)
        {
            //向目的地走
            this.tickDir = Math_F.TwoPositionDir(this.ownerEntity.position, this.nextPos);

            //活动移动量
            this.tickSpeed = this.speed * deltaTimeMS * 0.001f;
            this.tickMove  = this.tickDir * this.tickSpeed;

            //新位置
            this.ownerEntity.position += this.tickMove;
        }