Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Created April 15, 2018 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsubaki/37c15c11e4a1b2a1490b43b38c28ef6c to your computer and use it in GitHub Desktop.
Save tsubaki/37c15c11e4a1b2a1490b43b38c28ef6c to your computer and use it in GitHub Desktop.
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