public void CrossfadeQueue_WithNoClipAttached_FailsOnCall([ValueSource(typeof(ComparativeTestFixture), "Sources")] System.Type type) { IAnimation animation = ComparativeTestFixture.Instantiate(type); LogAssert.Expect(LogType.Error, new Regex("")); animation.CrossFadeQueued("UnknownState", 0f, QueueMode.CompleteOthers); }
public IEnumerator CrossfadeQueue_WithInvalidName_FailsOnCall([ValueSource(typeof(ComparativeTestFixture), "Sources")] System.Type type) { IAnimation animation = ComparativeTestFixture.Instantiate(type); var clip = Resources.Load <AnimationClip>("LinearX"); var clipInstance = Object.Instantiate <AnimationClip>(clip); clipInstance.legacy = animation.usesLegacy; animation.AddClip(clipInstance, "ToPlay"); LogAssert.Expect(LogType.Error, new Regex("")); animation.CrossFadeQueued("invalidName", 0f, QueueMode.CompleteOthers); yield return(null); }
public IEnumerator CrossfadeQueue_WithNoClipPlaying_IsStatePlaying_ReturnsTrue([ValueSource(typeof(ComparativeTestFixture), "Sources")] System.Type type) { IAnimation animation = ComparativeTestFixture.Instantiate(type); var clip = Resources.Load <AnimationClip>("LinearX"); var clipInstance = Object.Instantiate <AnimationClip>(clip); clipInstance.legacy = animation.usesLegacy; animation.AddClip(clipInstance, "ToPlay"); animation.CrossFadeQueued("ToPlay", 0f, QueueMode.CompleteOthers); yield return(null); Assert.IsTrue(animation.IsPlaying("ToPlay")); }
public IEnumerator CrossfadeQueue_WithClipPlaying_IsStatePlaying_AfterOriginalClipDone_ReturnsTrue([ValueSource(typeof(ComparativeTestFixture), "Sources")] System.Type type) { IAnimation animation = ComparativeTestFixture.Instantiate(type); var clipX = Resources.Load <AnimationClip>("LinearX"); var clipY = Resources.Load <AnimationClip>("LinearY"); var clipInstanceX = Object.Instantiate <AnimationClip>(clipX); var clipInstanceY = Object.Instantiate <AnimationClip>(clipY); clipInstanceX.legacy = animation.usesLegacy; clipInstanceY.legacy = animation.usesLegacy; animation.AddClip(clipInstanceY, "ToPlay"); animation.AddClip(clipInstanceX, "ToCrossfade"); animation.Play("ToPlay"); animation.CrossFadeQueued("ToCrossfade", 0.0f, QueueMode.CompleteOthers); yield return(new WaitForSeconds(1.1f)); Assert.IsTrue(animation.IsPlaying("ToCrossfade")); }