public void GetRigAnimation(RigAnimationName animation, Action <AnimationClip> foundAnimationClipCallback) { // TODO: This is a bit of a hack should probably be removed. if (animation == RigAnimationName.None) { Debug.LogError("animation being passed into GetRigAnimation is 'None'."); return; } // Check if we have the the rig animation asset already. if (mRigAnimationLookUpTable.ContainsKey(animation)) { foundAnimationClipCallback(mRigAnimationLookUpTable[animation].AnimationClip); return; } // If we don't have the rig animation asset already grab the info from the lookup table and loaded it from the repo. // The repo calls the AddRigAnimation function in the class which puts it in the rig animation lookup table. if (!mEmoteToAssetInfoLookUpTable.ContainsKey(animation)) { Debug.LogError("There is no asset info for the animation: " + animation.ToString()); return; } mClientAssetRepository.GetAsset <RigAnimationAsset>(mEmoteToAssetInfoLookUpTable[animation], delegate(RigAnimationAsset asset) { foundAnimationClipCallback(asset.AnimationClip); }); }
private void SetupAssetsFromItemsXml(string roomItemsXmlString) { XmlDocument roomDna = new XmlDocument(); roomDna.LoadXml(roomItemsXmlString); ClientAssetRepository clientAssetRepository = GameFacade.Instance.RetrieveProxy <ClientAssetRepository>(); XmlNodeList itemXmlNodes = roomDna.SelectNodes("Items/Item"); foreach (XmlNode itemXmlNode in itemXmlNodes) { XmlNodeList assetXmlNodes = itemXmlNode.SelectNodes("Assets/Asset"); foreach (XmlNode assetXmlNode in assetXmlNodes) { AssetInfo assetInfo = new ClientAssetInfo(assetXmlNode); clientAssetRepository.GetAsset <Asset>(assetInfo, ApplyAssetToType); } } }