Last active
March 21, 2020 17:42
-
-
Save tsubaki/3f9bb37216934d2fa0ddff32415b27ff to your computer and use it in GitHub Desktop.
新しいEntitiesを使用するためのコード
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Unity.Entities; | |
using Unity.Jobs; | |
using Unity.Mathematics; | |
using Unity.Transforms; | |
public class MySystem : SystemBase | |
{ | |
protected override void OnUpdate() | |
{ | |
var time = UnityEngine.Time.timeSinceLevelLoad; | |
this.Dependency = Entities.ForEach((ref Translation position) => | |
{ | |
position.Value += new float3(0, math.sin(time) ,0); | |
}).ScheduleParallel(this.Dependency); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ポイント