Created
April 15, 2018 16:43
-
-
Save tsubaki/37c15c11e4a1b2a1490b43b38c28ef6c to your computer and use it in GitHub Desktop.
This file contains 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 UnityEngine; | |
using Unity.Entities; | |
public class JumpAnimationSystem : ComponentSystem | |
{ | |
struct Group | |
{ | |
public Rigidbody2D rigidbody2ds; | |
public Animator animator; | |
} | |
protected override void OnUpdate() | |
{ | |
var group = GetEntities<Group>()[0]; | |
var velocity = group.rigidbody2ds.velocity.y; | |
group.animator.SetFloat("velocity", velocity); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment