public static Animator2D CreateAnimatedObjectEffectInstance([NotNull] AnimatedObjectDefinition definition, string animationName, [NotNull] Transform parent) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) if (null == definition) { throw new NullReferenceException(); } if (null == s_instance) { Log.Error("CreateAnimatedObjectEffectInstance called while the factory is not ready.", 367, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\FightObjectFactory.cs"); return(null); } Animator2D component = s_animatedObjectEffectPool.Instantiate(parent.get_position(), Quaternion.get_identity(), parent).GetComponent <Animator2D>(); if (!string.IsNullOrEmpty(animationName)) { component.SetAnimation(animationName, false, false, true); } else { component.set_animationLoops(false); } component.SetDefinition(definition, null, (Graphic[])null); return(component); }
public unsafe void SetCharacterData(AnimatedFightCharacterData data, AnimatedObjectDefinition def) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown m_characterData = data; m_animator2D.add_Initialised(new Animator2DInitialisedEventHandler((object)this, (IntPtr)(void *) /*OpCode not supported: LdFtn*/)); m_animator2D.SetDefinition(def, null, (Graphic[])null); }
private IEnumerator LoadCharacterSkin() { if (!string.IsNullOrEmpty(m_lastLoadedCharacterBundle)) { this.UnloadAssetBundle(m_lastLoadedCharacterBundle, true, true); m_lastLoadedCharacterBundle = null; } PlayerData instance = PlayerData.instance; Gender gender = instance.gender; Id <CharacterSkinDefinition> skin = instance.Skin; if (skin == null || !RuntimeData.characterSkinDefinitions.TryGetValue(skin.value, out CharacterSkinDefinition characterSkinDefinition)) { yield break; } BundleCategory bundleCategory = characterSkinDefinition.bundleCategory; string bundleName = m_lastLoadedCharacterBundle = AssetBundlesUtility.GetAnimatedCharacterDataBundle(bundleCategory); AssetBundleLoadRequest bundleLoadRequest = this.LoadAssetBundle(bundleName); while (!bundleLoadRequest.get_isDone()) { yield return(null); } if (AssetManagerError.op_Implicit(bundleLoadRequest.get_error()) != 0) { Log.Error($"Failed to load asset bundle named '{bundleName}' for character skin {characterSkinDefinition.get_displayName()} ({characterSkinDefinition.get_id()}): {bundleLoadRequest.get_error()}", 253, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\States\\HavreDimension\\HavreDimensionMainState.cs"); yield break; } AssetReference animatedCharacterDataReference = characterSkinDefinition.GetAnimatedCharacterDataReference(gender); AssetLoadRequest <AnimatedCharacterData> animatedCharacterDataLoadRequest = animatedCharacterDataReference.LoadFromAssetBundleAsync <AnimatedCharacterData>(bundleName); while (!animatedCharacterDataLoadRequest.get_isDone()) { yield return(null); } if (AssetManagerError.op_Implicit(animatedCharacterDataLoadRequest.get_error()) != 0) { this.UnloadAssetBundle(bundleName, true, true); Log.Error(string.Format("Failed to load {0} asset from bundle '{1}' for character skin {2} ({3}): {4}", "AnimatedCharacterData", bundleName, characterSkinDefinition.get_displayName(), characterSkinDefinition.get_id(), animatedCharacterDataLoadRequest.get_error()), 269, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\States\\HavreDimension\\HavreDimensionMainState.cs"); yield break; } AnimatedCharacterData animatedCharacterData = animatedCharacterDataLoadRequest.get_asset(); yield return(animatedCharacterData.LoadTimelineResources()); AnimatedFightCharacterData animatedFightCharacterData = animatedCharacterData as AnimatedFightCharacterData; AnimatedObjectDefinition animatedObjectDefinition = animatedFightCharacterData.animatedObjectDefinition; m_havreMap.character.SetCharacterData(animatedFightCharacterData, animatedObjectDefinition); m_loadCharacterCoroutine = null; }