public void Rocking(UIRocker.Direction direction) { if (animator == null) { return; } switch (direction) { case UIRocker.Direction.Up: animator.Play("walk"); break; case UIRocker.Direction.Down: animator.Play("idle"); break; case UIRocker.Direction.Left: go.transform.localEulerAngles = Vector3.zero; break; case UIRocker.Direction.Right: go.transform.localEulerAngles = new Vector3(0, 180, 0); break; } }
void Rock(RolePage role, UIRocker.Direction direction) { role.Rocking(direction); }