/// <summary> /// Called by the Entity Framework. If overriding, you must call the base method. /// </summary> /// <param name="frameTime">Frame time.</param> /// <param name="pauseMode">Pause mode.</param> public override void OnUpdate(float frameTime, PauseMode pauseMode) { if (Exists) { lastPos = NativeEntity.GetPos(); lastRot = NativeEntity.GetRotation(); lastScale = NativeEntity.GetScale(); } handlers.ToList().ForEach(x => x.Update(frameTime, pauseMode)); }
internal static EntityBase CreateNativeEntity(EntityId id, IntPtr entityPointer) { // check if actor var actorInfo = NativeActorMethods.GetActorInfoById((uint)id._value); if (actorInfo.Id != 0) { return(Actor.CreateNativeActor(actorInfo)); } var nativeEntity = new NativeEntity(id, entityPointer); ScriptManager.Instance.AddScriptInstance(nativeEntity, ScriptType.Entity); return(nativeEntity); }