public bool updateTransform(out Vector3 position, ref Quaternion rotation) { mCrowdManager.Update(Time.deltaTime); //Debug.Log("pos" + mCrowdAgent.Position); position = mCrowdAgent.Position; Quaternion desRotation = Quaternion.LookRotation(new Vector3(mCrowdAgent.DesiredVelocity.x, 0, mCrowdAgent.DesiredVelocity.z)); rotation = Quaternion.Slerp(rotation, desRotation, Time.deltaTime * this.mTurnSpeed); return(true); }
void Update() { if (m_Mgr != null) { float delta = Time.unscaledDeltaTime; m_Mgr.Update(delta); } else { if (NavMeshMap.IsVaild) { var mesh = NavMeshMap.GetNavMesh(); if (mesh != null) { this._Init(mesh); } } } }