Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. [SetUp]
  2. public void SetUp()
  3. {
  4. Crystal = GameObject.FindGameObjectWithTag("CrystalModel");
  5.  
  6. CrystalScript = Crystal.GetComponent<CrystalChanPlayer>();
  7. CrystalAnimator = Crystal.GetComponent<Animator>(); //unity game animator
  8. }
  9.  
  10. [Test]
  11. public void ifSetAnimationIstodoThenToDoAnimationIsPlayed()
  12. {
  13. CrystalScript.setAnimationStrategy("todo"); //set strategy
  14. CrystalScript.playAnimation(); //sets todo boolean to true and idle to false
  15.  
  16.  
  17. //first output
  18. Debug.LogError("todo is " + CrystalAnimator.GetBool("isDoing")+" idle is "+CrystalAnimator.GetBool("isIdle"));
  19.  
  20. //second output
  21. Debug.LogError("current state is "+ CrystalAnimator.GetCurrentAnimatorStateInfo(0).IsName("idle"));
  22.  
  23.  
  24. Assert.True(CrystalAnimator.GetCurrentAnimatorStateInfo(0).IsName("todoAnimation"));
  25.  
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement