Skip to content

Commit

Permalink
Difficulty decreased and final fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
WinCisky committed Jan 25, 2020
1 parent c01b60e commit 595df64
Show file tree
Hide file tree
Showing 73 changed files with 125 additions and 42 deletions.
2 changes: 1 addition & 1 deletion Assets/Build/Windows-DotNet-Tiny3D.buildsettings
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"EnableBurst": true,
"RootAssembly": "GlobalObjectId_V1-1-9c93346065c8be04c834bea5c41079be-5897886265953266890-0",
"Target": "windows-dotnet",
"Configuration": 2,
"Configuration": 1,
"Pipeline": "GlobalObjectId_V1-1-56241f83dacec1141b7d967eb30bf934-93214019566545601-0",
"BeeTargetOverride": null
}]
Expand Down
8 changes: 8 additions & 0 deletions Assets/Library.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/Library/DotsRuntimeBuild.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/Library/DotsRuntimeBuild/artifacts.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/Library/DotsRuntimeBuild/artifacts/Tiny3D.dll.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 1 addition & 14 deletions Assets/Scenes/DOTS Subscene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ LightmapSettings:
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
m_UseShadowmask: 0
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
Expand Down Expand Up @@ -216,7 +216,6 @@ GameObject:
m_Component:
- component: {fileID: 285469726}
- component: {fileID: 285469727}
- component: {fileID: 285469728}
m_Layer: 0
m_Name: FirstRow_20
m_TagString: Untagged
Expand Down Expand Up @@ -257,18 +256,6 @@ MonoBehaviour:
z: 0
character: {fileID: 4678712600350111070, guid: 6bdce7e4307b98d429740e8cdcc7b3ec,
type: 3}
--- !u!114 &285469728
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 285469725}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a61356ff9d9e1324595ea253cca75e08, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &594555747
GameObject:
m_ObjectHideFlags: 0
Expand Down
8 changes: 8 additions & 0 deletions Assets/Scripts/Components.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 0 additions & 4 deletions Assets/Scripts/MenuItem.cs

This file was deleted.

11 changes: 0 additions & 11 deletions Assets/Scripts/MenuItem.cs.meta

This file was deleted.

8 changes: 8 additions & 0 deletions Assets/Scripts/Systems.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
using Unity.Entities;
using Unity.Jobs;
using Unity.Mathematics;
using Unity.Transforms;
#if UNITY_DOTSPLAYER
using Unity.Tiny.Rendering;
using Unity.Tiny.Input;
using Unity.Transforms;

#endif
[AlwaysSynchronizeSystem]
public class FollowPlayerSystem : ComponentSystem
{
Expand All @@ -17,19 +14,24 @@ protected override void OnUpdate()
var deltaTime = Time.DeltaTime;
var cameraPos = new float3(0, 0, 0);
var playerPos = new float3(0, 0, 0);

Entities.WithAll<Player>().ForEach((ref Translation translation) =>
{
#if UNITY_DOTSPLAYER
var cameraEntity = GetSingletonEntity<Camera>();
cameraPos = EntityManager.GetComponentData<Translation>(cameraEntity).Value;
EntityManager.SetComponentData(cameraEntity, new Translation { Value = math.lerp(cameraPos, translation.Value + offset, deltaTime * followSpeed) });
#else
cameraPos = UnityEngine.Camera.main.transform.position;
cameraPos = math.lerp(cameraPos, translation.Value + offset, deltaTime * followSpeed);
#endif
playerPos = translation.Value;
});

//NOT WORKING! -> can't change the background color at runtime :(
//Entities.ForEach((ref Camera cam) =>
//{
// cam.backgroundColor.r = 0;
// cam.backgroundColor.g = 0;
// cam.backgroundColor.b = 0;
// cam.backgroundColor.Value = new float4(0, 0, 0, 0);
//});

//let the ui follow the player
Entities.ForEach((ref Translation translation, ref Digit d) =>
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ protected override JobHandle OnUpdate(JobHandle inputDeps)
// The actual job will be cached once it is compiled (it will only get Burst compiled once).
var jobHandle = Entities
.WithName("Spawner")
//.WithBurst(FloatMode.Default, FloatPrecision.Standard, true)
.WithoutBurst()
.WithBurst(FloatMode.Default, FloatPrecision.Standard, true)
//.WithoutBurst()
.ForEach((Entity entity, int entityInQueryIndex, in Spawner spawnerFromEntity, in LocalToWorld location) =>
{
for (var x = -spawnerFromEntity.CountX; x < spawnerFromEntity.CountX; x++)
Expand All @@ -54,7 +54,7 @@ protected override JobHandle OnUpdate(JobHandle inputDeps)
// Place the instantiated in a grid with some noise

var position = math.transform(location.Value,
new float3(x, y, (noise.cnoise(new float2(x, y + (float)elapsedT + 9) * 0.21F) + 0.2) > 0 ? -100 : 0));
new float3(x, y, (noise.cnoise(new float2(x, y + (float)elapsedT + 9) * 0.21F) + 0.22) > 0 ? -100 : 0));
commandBuffer.SetComponent(entityInQueryIndex, instance, new Translation {Value = position});
commandBuffer.SetComponent(entityInQueryIndex, instance, new ObstacleTag {StartTime = elapsedT + 9, startPos = position, MovementSpeed = 5, Swapped = true});
}
Expand Down

0 comments on commit 595df64

Please sign in to comment.