Skip to content

Commit 756d3ce

Browse files
author
toinfiniityandbeyond
committed
Initial commit
0 parents  commit 756d3ce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2655
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.gitignore

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/[Ll]ibrary/
2+
/[Tt]emp/
3+
/[Oo]bj/
4+
/[Bb]uild/
5+
/[Bb]uilds/
6+
7+
# Binaries and custom/local-only folders I don't want synced
8+
Assets/OtherAssets/
9+
Assets/Plugins/
10+
Assets/Standard Assets/
11+
Assets/AssetStoreTools/
12+
13+
# JetBrains Rider cache directory ?
14+
.idea
15+
16+
# Visual Studio 2015 cache directory
17+
/.vs/
18+
19+
# Autogenerated VS/MD/Consulo solution and project files
20+
ExportedObj/
21+
.consulo/
22+
*.csproj
23+
*.unityproj
24+
*.sln
25+
*.suo
26+
*.tmp
27+
*.user
28+
*.userprefs
29+
*.pidb
30+
*.booproj
31+
*.svd
32+
*.pdb
33+
34+
# Unity3D generated meta files
35+
*.pidb.meta
36+
37+
# Unity3D Generated File On Crash Reports
38+
sysinfo.txt
39+
40+
# Builds
41+
*.apk
42+
*.unitypackage
43+
44+
# Potential OS generated files
45+
.DS_Store*
46+
._*
47+
.Spotlight-V100
48+
.Trashes
49+
[Tt]humbs.db

Assets/ECS SpriteRenderer.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/ECS SpriteRenderer/Example.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using Unity.Entities;
2+
using Unity.Mathematics;
3+
using Unity.Transforms2D;
4+
using UnityEngine;
5+
6+
//Just gives the animals a little movement as an example
7+
public class EntityMovementSystem : ComponentSystem
8+
{
9+
[Inject] private Data data;
10+
11+
protected override void OnUpdate()
12+
{
13+
var dt = Time.deltaTime;
14+
15+
for (var index = 0; index < data.Length; ++index)
16+
{
17+
var position = data.Position[index].Value;
18+
var heading = data.Heading[index].Value;
19+
20+
float wobbleX = Mathf.PerlinNoise(position.x, position.y) - 0.5f;
21+
float wobbleY = Mathf.PerlinNoise(position.y, position.x) - 0.5f;
22+
position += dt * new float2(wobbleX, wobbleY);
23+
24+
data.Position[index] = new Position2D {Value = position};
25+
data.Heading[index] = new Heading2D {Value = heading};
26+
}
27+
}
28+
29+
public struct Data
30+
{
31+
public int Length;
32+
public ComponentDataArray<Position2D> Position;
33+
public ComponentDataArray<Heading2D> Heading;
34+
}
35+
}

Assets/ECS SpriteRenderer/Example/EntityMovementSystem.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)