public void TransferAnimationTest(string prefabPath) { prefabPath = FindPathInUnitTests(prefabPath); Assert.That(prefabPath, Is.Not.Null); var go = AddAssetToScene(prefabPath); Assert.That(go); AnimationInputSettings animationInputSettings = new AnimationInputSettings(); animationInputSettings.gameObject = go; FbxRecorderSettings settings = ScriptableObject.CreateInstance(typeof(FbxRecorderSettings)) as FbxRecorderSettings; settings.animationInputSettings = animationInputSettings; settings.TransferAnimationSource = go.transform; Transform skeletonNode = go.transform.GetChild(2); settings.TransferAnimationDest = skeletonNode; // Assignment of the AnimationSource and AnimationDest transforms also tests the GetBinding and SetBinding methods // of the FbxRecorderSettings class which previously used a private API. Assert.That(settings.TransferAnimationSource, Is.Not.Null); Assert.That(settings.TransferAnimationSource, Is.EqualTo(go.transform)); Assert.That(settings.TransferAnimationDest, Is.Not.Null); Assert.That(settings.TransferAnimationDest, Is.EqualTo(skeletonNode)); }
private string ReplaceTokens(string input, AnimationRecorderSettings ars, AnimationInputSettings ais) { var idx = m_Inputs.Select(x => x.settings).ToList().IndexOf(ais); return(input.Replace(AnimationRecorderSettings.goToken, ais.gameObject.name) .Replace(AnimationRecorderSettings.inputToken, (idx + 1).ToString("00")) .Replace(AnimationRecorderSettings.takeToken, ars.take.ToString("000"))); }
public void AnimationInputSettings_ShouldHaveProperPublicAPI() { var cube = GameObject.CreatePrimitive(PrimitiveType.Cube); var input = new AnimationInputSettings { gameObject = cube }; input.AddComponentToRecord(typeof(Transform)); input.AddComponentToRecord(typeof(Renderer)); Assert.IsTrue(input.gameObject == cube); input.gameObject = null; Assert.IsTrue(input.gameObject == null); }