public void SpeciesCry_PlaysAppropriateAudioClip() { _species.TestStart(); const ECryType expectedCryType = ECryType.Positive; _species.SpeciesCry(expectedCryType); Assert.AreSame(_positiveClip, _species.PlayedAudioClip); }
public void IsSpeciesCryInProgress_Finished_False() { _species.TestStart(); const ECryType expectedCryType = ECryType.Positive; _species.SpeciesCry(expectedCryType); _species.TestUpdate(_positiveClip.length + 0.1f); Assert.IsFalse(_species.IsSpeciesCryInProgress(expectedCryType)); }
public void SpeciesCry(ECryType inCryType) { if (!IsCryInProgress()) { _cryInProgress = inCryType; UnityMessageEventFunctions.InvokeMessageEventWithDispatcher(gameObject, new SpeciesCryMessage(_cryInProgress.Value)); if (_speciesCryMap.ContainsKey(inCryType)) { _currentCry = _speciesCryMap[inCryType]; PlayAudioClip(_currentCry); } } }
public void SpeciesCry_SendsSpeciesCryMessage() { _species.TestStart(); const ECryType expectedCryType = ECryType.Positive; var messageSpy = new UnityTestMessageHandleResponseObject <SpeciesCryMessage>(); var handle = UnityMessageEventFunctions.RegisterActionWithDispatcher <SpeciesCryMessage>(_species.gameObject, messageSpy.OnResponse); _species.SpeciesCry(expectedCryType); Assert.IsTrue(messageSpy.ActionCalled); Assert.AreEqual(expectedCryType, messageSpy.MessagePayload.Cry); UnityMessageEventFunctions.UnregisterActionWithDispatcher(_species.gameObject, handle); }
public void SpeciesCry_UpdateLessThanLengthOfClip_CannotSendMessageAgain() { _species.TestStart(); const ECryType expectedCryType = ECryType.Positive; _species.SpeciesCry(expectedCryType); _species.TestUpdate(_positiveClip.length - 0.1f); var messageSpy = new UnityTestMessageHandleResponseObject <SpeciesCryMessage>(); var handle = UnityMessageEventFunctions.RegisterActionWithDispatcher <SpeciesCryMessage>(_species.gameObject, messageSpy.OnResponse); _species.SpeciesCry(expectedCryType); Assert.IsFalse(messageSpy.ActionCalled); UnityMessageEventFunctions.UnregisterActionWithDispatcher(_species.gameObject, handle); }
public CryAudioClipEntry(ECryType inCryType, AudioClip inCrySound) { CryType = inCryType; CrySound = inCrySound; }
public bool IsSpeciesCryInProgress(ECryType inCryType) { return(_cryInProgress == inCryType); }
public bool IsSpeciesCryInProgress(ECryType inCryType) { IsSpeciesCryInProgressInput = inCryType; return(IsSpeciesCryInProgressResult); }
public void SpeciesCry(ECryType inCryType) { SpeciesCryCalled = true; SpeciesCryTypeInput = inCryType; }
public SpeciesCryMessage(ECryType inCry) : base() { Cry = inCry; }