protected override void OnUpdate() { { Entities.With(Component_Query).ForEach((Unity.Entities.Entity Component_QueryEntity, PlayerControllerVS Component_QueryPlayerControllerVS, ref Unity.Transforms.Translation Component_QueryTranslation) => { var Variable = 0F; var var = 0F; Component_QueryTranslation.Value.x = math.clamp((Component_QueryTranslation.Value.x + ((UnityEngine.Input.GetAxis("Horizontal") * Time.deltaTime) * Component_QueryPlayerControllerVS.Speed)), -9F, 9F); Component_QueryTranslation.Value.y = 0.55F; Component_QueryTranslation.Value.z = math.clamp((Component_QueryTranslation.Value.z + ((UnityEngine.Input.GetAxis("Vertical") * Time.deltaTime) * Component_QueryPlayerControllerVS.Speed)), -9F, 9F); { var Pickup_QueryEntities = Pickup_Query.ToEntityArray(Allocator.TempJob); var Pickup_QueryTranslationArray = Pickup_Query.ToComponentDataArray <Unity.Transforms.Translation>(Allocator.TempJob); for (int Pickup_QueryIdx = 0; Pickup_QueryIdx < Pickup_QueryEntities.Length; Pickup_QueryIdx++) { var Pickup_QueryEntity = Pickup_QueryEntities[Pickup_QueryIdx]; var Pickup_QueryTranslation = Pickup_QueryTranslationArray[Pickup_QueryIdx]; if ((1F >= math.distance(Component_QueryTranslation.Value, Pickup_QueryTranslation.Value))) { PostUpdateCommands.AddComponent <DestroyTag>(Pickup_QueryEntity, new DestroyTag { }); } } Pickup_QueryTranslationArray.Dispose(); Pickup_QueryEntities.Dispose(); } } ); } }
protected override void OnUpdate() { { Entities.With(Camera_Query).ForEach((Unity.Entities.Entity Camera_QueryEntity, UnityEngine.Transform Camera_QueryTransform) => { var offset = new float3(0F, 10F, -10F); { var Player_QueryEntities = Player_Query.ToEntityArray(Allocator.TempJob); var Player_QueryTranslationArray = Player_Query.ToComponentDataArray <Unity.Transforms.Translation>(Allocator.TempJob); for (int Player_QueryIdx = 0; Player_QueryIdx < Player_QueryEntities.Length; Player_QueryIdx++) { var Player_QueryEntity = Player_QueryEntities[Player_QueryIdx]; var Player_QueryTranslation = Player_QueryTranslationArray[Player_QueryIdx]; Camera_QueryTransform.position = (Player_QueryTranslation.Value + offset); } Player_QueryTranslationArray.Dispose(); Player_QueryEntities.Dispose(); } } ); } }