示例#1
0
        protected override IEnumerator Unload()
        {
            while (FightLogicExecutor.isValid)
            {
                yield return(null);
            }
            FightMap current = FightMap.current;

            if (null != current)
            {
                current.Release();
                FightMap.current = null;
            }
            if (FightSpellEffectFactory.isReady)
            {
                yield return(FightSpellEffectFactory.Unload());
            }
            if (FightObjectFactory.isReady)
            {
                yield return(FightObjectFactory.Unload());
            }
            if (FightUIFactory.isReady)
            {
                yield return(FightUIFactory.Unload());
            }
            VisualEffectFactory.Dispose();
            yield return(RuntimeData.UnloadTextCollectionAsync("Fight"));

            yield return(_003C_003En__0());

            DragNDropListener.instance.CancelSnapDrag();
            instance = null;
        }
        public override Component Instantiate(Transform parent, Quaternion rotation, Vector3 scale, FightContext fightContext, ITimelineContextProvider contextProvider)
        {
            //IL_0032: Unknown result type (might be due to invalid IL or missing references)
            //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)
            //IL_0042: Unknown result type (might be due to invalid IL or missing references)
            //IL_0051: Unknown result type (might be due to invalid IL or missing references)
            //IL_0062: Unknown result type (might be due to invalid IL or missing references)
            //IL_0063: Unknown result type (might be due to invalid IL or missing references)
            //IL_0064: Unknown result type (might be due to invalid IL or missing references)
            if (null == m_visualEffect)
            {
                Log.Warning("Tried to instantiate visual character effect named '" + this.get_name() + "' without a visual effect setup.", 84, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\Animations\\VisualSpellEffect.cs");
                return(null);
            }
            Vector3 position = parent.get_position() + m_positionOffset;

            if (m_sound.get_isValid())
            {
                AudioManager.PlayOneShot(m_sound, parent);
            }
            VisualEffect visualEffect = VisualEffectFactory.Instantiate(m_visualEffect, position, rotation, scale, parent);

            visualEffect.destructionOverride = OnInstanceDestructionRequest;
            return(visualEffect);
        }
示例#3
0
        public override Component Instantiate(Transform parent, ITimelineContextProvider contextProvider)
        {
            //IL_0032: Unknown result type (might be due to invalid IL or missing references)
            //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)
            //IL_0042: Unknown result type (might be due to invalid IL or missing references)
            //IL_0043: Unknown result type (might be due to invalid IL or missing references)
            //IL_0048: Unknown result type (might be due to invalid IL or missing references)
            //IL_0049: Unknown result type (might be due to invalid IL or missing references)
            //IL_004e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0077: Unknown result type (might be due to invalid IL or missing references)
            //IL_007c: Unknown result type (might be due to invalid IL or missing references)
            //IL_00b4: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c5: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c6: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c7: Unknown result type (might be due to invalid IL or missing references)
            if (null == m_visualEffect)
            {
                Log.Warning("Tried to instantiate visual character effect named '" + this.get_name() + "' without a visual effect setup.", 95, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\Animations\\VisualCharacterEffect.cs");
                return(null);
            }
            Vector3    position = parent.get_position() + m_positionOffset;
            Quaternion rotation = Quaternion.get_identity();
            Vector3    scale    = Vector3.get_one();

            switch (m_orientationMethod)
            {
            case OrientationMethod.None:
            {
                CameraHandler current = CameraHandler.current;
                if (null != current)
                {
                    rotation = current.mapRotation.GetInverseRotation();
                }
                break;
            }

            case OrientationMethod.Context:
                if (contextProvider != null)
                {
                    (contextProvider.GetTimelineContext() as VisualEffectContext)?.GetVisualEffectTransformation(out rotation, out scale);
                }
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            if (m_sound.get_isValid())
            {
                AudioManager.PlayOneShot(m_sound, parent);
            }
            VisualEffect visualEffect = VisualEffectFactory.Instantiate(m_visualEffect, position, rotation, scale, parent);

            visualEffect.destructionOverride = OnInstanceDestructionRequest;
            return(visualEffect);
        }
示例#4
0
        public IEnumerator LoadResources()
        {
            if (!m_prefabReference.get_hasValue())
            {
                yield break;
            }
            GameObject asset;

            if (string.IsNullOrEmpty(m_assetBundleName))
            {
                AssetReferenceRequest <GameObject> assetReferenceRequest2 = m_prefabReference.LoadFromResourcesAsync <GameObject>();
                while (!assetReferenceRequest2.get_isDone())
                {
                    yield return(null);
                }
                asset = assetReferenceRequest2.get_asset();
            }
            else
            {
                AssetBundleLoadRequest bundleRequest = AssetManager.LoadAssetBundle(m_assetBundleName);
                while (!bundleRequest.get_isDone())
                {
                    yield return(null);
                }
                if (AssetManagerError.op_Implicit(bundleRequest.get_error()) != 0)
                {
                    Log.Error($"Could not load bundle named '{m_assetBundleName}': {bundleRequest.get_error()}", 99, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Animations\\VisualEffectPlayableAsset.cs");
                    yield break;
                }
                m_loadedAssetBundle = true;
                AssetLoadRequest <GameObject> assetReferenceRequest = m_prefabReference.LoadFromAssetBundleAsync <GameObject>(m_assetBundleName);
                while (!assetReferenceRequest.get_isDone())
                {
                    yield return(null);
                }
                if (AssetManagerError.op_Implicit(assetReferenceRequest.get_error()) != 0)
                {
                    Log.Error($"Could not load requested asset ({m_prefabReference.get_value()}) from bundle named '{m_assetBundleName}': {assetReferenceRequest.get_error()}", 113, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Animations\\VisualEffectPlayableAsset.cs");
                    yield break;
                }
                asset = assetReferenceRequest.get_asset();
            }
            VisualEffect component = asset.GetComponent <VisualEffect>();

            if (null == component)
            {
                Log.Error("Could not use prefab because it doesn't have a VisualEffect component.", 123, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Animations\\VisualEffectPlayableAsset.cs");
                yield break;
            }
            VisualEffectFactory.PreparePool(asset);
            m_prefab = component;
        }
示例#5
0
        public VisualEffect InstantiateMainEffect([NotNull] Transform parent, [CanBeNull] ITimelineContextProvider contextProvider)
        {
            //IL_003e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0044: Unknown result type (might be due to invalid IL or missing references)
            //IL_0049: Unknown result type (might be due to invalid IL or missing references)
            //IL_004e: Unknown result type (might be due to invalid IL or missing references)
            //IL_004f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0054: Unknown result type (might be due to invalid IL or missing references)
            //IL_006d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0072: Unknown result type (might be due to invalid IL or missing references)
            //IL_0074: Unknown result type (might be due to invalid IL or missing references)
            //IL_0079: Unknown result type (might be due to invalid IL or missing references)
            //IL_0084: Unknown result type (might be due to invalid IL or missing references)
            //IL_008d: Unknown result type (might be due to invalid IL or missing references)
            //IL_008e: Unknown result type (might be due to invalid IL or missing references)
            //IL_008f: Unknown result type (might be due to invalid IL or missing references)
            EffectData   mainEffect   = m_mainEffect;
            VisualEffect visualEffect = mainEffect.visualEffect;

            if (null == visualEffect)
            {
                Log.Warning("Tried to instantiate attachable effect named '" + this.get_name() + "' without a visual effect setup.", 163, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\Animations\\AttachableEffect.cs");
                return(null);
            }
            Vector3       position = parent.get_position() + mainEffect.positionOffset;
            Quaternion    rotation = Quaternion.get_identity();
            CameraHandler current  = CameraHandler.current;

            if (null != current)
            {
                rotation = current.mapRotation.GetInverseRotation();
            }
            AudioReferenceWithParameters sound = mainEffect.sound;

            if (sound.get_isValid())
            {
                AudioManager.PlayOneShot(sound, parent);
            }
            VisualEffect visualEffect2 = VisualEffectFactory.Instantiate(visualEffect, position, rotation, Vector3.get_one(), parent);

            visualEffect2.destructionOverride = OnMainEffectInstanceDestructionRequest;
            return(visualEffect2);
        }
示例#6
0
        public VisualEffect InstantiateStopEffect([NotNull] Transform parent, [CanBeNull] ITimelineContextProvider contextProvider)
        {
            //IL_001a: Unknown result type (might be due to invalid IL or missing references)
            //IL_0020: Unknown result type (might be due to invalid IL or missing references)
            //IL_0025: Unknown result type (might be due to invalid IL or missing references)
            //IL_002a: Unknown result type (might be due to invalid IL or missing references)
            //IL_002b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0030: Unknown result type (might be due to invalid IL or missing references)
            //IL_0049: Unknown result type (might be due to invalid IL or missing references)
            //IL_004e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0050: Unknown result type (might be due to invalid IL or missing references)
            //IL_0055: Unknown result type (might be due to invalid IL or missing references)
            //IL_0060: Unknown result type (might be due to invalid IL or missing references)
            //IL_0069: Unknown result type (might be due to invalid IL or missing references)
            //IL_006a: Unknown result type (might be due to invalid IL or missing references)
            //IL_006b: Unknown result type (might be due to invalid IL or missing references)
            EffectData   stopEffect   = m_stopEffect;
            VisualEffect visualEffect = stopEffect.visualEffect;

            if (null == visualEffect)
            {
                return(null);
            }
            Vector3       position = parent.get_position() + stopEffect.positionOffset;
            Quaternion    rotation = Quaternion.get_identity();
            CameraHandler current  = CameraHandler.current;

            if (null != current)
            {
                rotation = current.mapRotation.GetInverseRotation();
            }
            AudioReferenceWithParameters sound = stopEffect.sound;

            if (sound.get_isValid())
            {
                AudioManager.PlayOneShot(sound, parent);
            }
            VisualEffect visualEffect2 = VisualEffectFactory.Instantiate(visualEffect, position, rotation, Vector3.get_one(), parent);

            visualEffect2.destructionOverride = OnStopEffectInstanceDestructionRequest;
            return(visualEffect2);
        }
 private void OnInstanceDestructionRequest(VisualEffect instance)
 {
     VisualEffectFactory.Release(m_visualEffect, instance);
 }
        private bool Start()
        {
            //IL_0000: Unknown result type (might be due to invalid IL or missing references)
            //IL_0005: Unknown result type (might be due to invalid IL or missing references)
            //IL_0006: Unknown result type (might be due to invalid IL or missing references)
            //IL_000b: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a2: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a8: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ad: Unknown result type (might be due to invalid IL or missing references)
            //IL_00b2: Unknown result type (might be due to invalid IL or missing references)
            //IL_00bb: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c1: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c6: Unknown result type (might be due to invalid IL or missing references)
            //IL_00cb: Unknown result type (might be due to invalid IL or missing references)
            //IL_0105: Unknown result type (might be due to invalid IL or missing references)
            //IL_010a: Unknown result type (might be due to invalid IL or missing references)
            //IL_012c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0131: Unknown result type (might be due to invalid IL or missing references)
            //IL_0143: Unknown result type (might be due to invalid IL or missing references)
            //IL_014b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0150: Unknown result type (might be due to invalid IL or missing references)
            //IL_015f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0160: Unknown result type (might be due to invalid IL or missing references)
            //IL_0161: Unknown result type (might be due to invalid IL or missing references)
            Quaternion rotation = Quaternion.get_identity();
            Vector3    scale    = Vector3.get_one();
            Transform  val;

            switch (m_parentingMode)
            {
            case VisualEffectPlayableAsset.ParentingMode.Owner:
                val = m_ownerTransform;
                break;

            case VisualEffectPlayableAsset.ParentingMode.Parent:
                val = m_ownerTransform.get_parent();
                break;

            case VisualEffectPlayableAsset.ParentingMode.ContextOwner:
                val = ((m_visualEffectContext != null) ? m_visualEffectContext.transform : m_ownerTransform);
                break;

            case VisualEffectPlayableAsset.ParentingMode.ContextParent:
                val = ((m_visualEffectContext != null) ? m_visualEffectContext.transform.get_parent() : m_ownerTransform.get_parent());
                break;

            case VisualEffectPlayableAsset.ParentingMode.World:
                val = null;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            Vector3 position = (!(null != val)) ? (m_ownerTransform.get_position() + m_offset) : (val.get_position() + m_offset);

            switch (m_orientationMethod)
            {
            case VisualEffectPlayableAsset.OrientationMethod.None:
            {
                CameraHandler current = CameraHandler.current;
                if (null != current)
                {
                    rotation = current.mapRotation.GetInverseRotation();
                }
                break;
            }

            case VisualEffectPlayableAsset.OrientationMethod.Context:
                if (m_visualEffectContext != null)
                {
                    m_visualEffectContext.GetVisualEffectTransformation(out rotation, out scale);
                }
                break;

            case VisualEffectPlayableAsset.OrientationMethod.Director:
                rotation = m_ownerTransform.get_rotation();
                break;

            case VisualEffectPlayableAsset.OrientationMethod.Transform:
                rotation = ((null != val) ? val.get_rotation() : m_ownerTransform.get_rotation());
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            VisualEffect visualEffect = VisualEffectFactory.Instantiate(m_prefab, position, rotation, scale, val);

            visualEffect.destructionOverride = OnVisualEffectInstanceDestructionRequest;
            if (m_visualEffectContext != null)
            {
                VisualEffectPlayableAsset.ParentingMode parentingMode = m_parentingMode;
                if ((uint)(parentingMode - 2) <= 1u)
                {
                    m_visualEffectContext.AddVisualEffect(visualEffect);
                }
            }
            visualEffect.Play();
            m_instance     = visualEffect.get_gameObject();
            m_visualEffect = visualEffect;
            return(true);
        }
 private void OnVisualEffectInstanceDestructionRequest(VisualEffect instance)
 {
     VisualEffectFactory.Release(m_prefab, instance);
 }
示例#10
0
        protected override IEnumerator Load()
        {
            if (m_concurrentFightsCount == 1)
            {
                RuntimeData.currentKeywordContext = KeywordContext.FightSolo;
            }
            else
            {
                RuntimeData.currentKeywordContext = KeywordContext.FightMulti;
            }
            instance = this;
            int fightCount = m_concurrentFightsCount;

            if (!RuntimeData.fightDefinitions.TryGetValue(m_fightDefId, out m_fightDefinition))
            {
                Log.Error(string.Format("Could not find {0} with id {1}.", "FightDefinition", m_fightDefId), 78, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\States\\FightState.cs");
                yield break;
            }
            yield return(RuntimeData.LoadTextCollectionAsync("Fight"));

            yield return(LoadSceneAndBundleRequest("FightMapWrapper", "core/scenes/maps/fight_maps"));

            Scene sceneByName = SceneManager.GetSceneByName("FightMapWrapper");

            if (!sceneByName.get_isLoaded())
            {
                Log.Error("Could not load scene named 'FightMapWrapper' from bundle 'core/scenes/maps/fight_maps'.", 93, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\States\\FightState.cs");
                yield break;
            }
            yield return(LoadFightMap());

            FightMap current = FightMap.current;

            if (null == current)
            {
                Log.Error("Failed to load fight map.", 104, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\States\\FightState.cs");
                yield break;
            }
            FightLogicExecutor.Initialize(fightCount);
            FightMapDefinition definition = current.definition;

            FightStatus[] array = new FightStatus[fightCount];
            for (int i = 0; i < fightCount; i++)
            {
                FightMapStatus mapStatus   = definition.CreateFightMapStatus(i);
                FightStatus    fightStatus = new FightStatus(i, mapStatus);
                if (fightStatus.fightId == m_ownFightId)
                {
                    FightStatus.local = fightStatus;
                }
                FightLogicExecutor.AddFightStatus(fightStatus);
                array[i] = fightStatus;
            }
            GameStatus.Initialize((FightType)m_fightInfo.FightType, m_fightDefinition, array);
            yield return(current.Initialize());

            VisualEffectFactory.Initialize();
            yield return(FightObjectFactory.Load());

            if (!FightObjectFactory.isReady)
            {
                yield break;
            }
            yield return(FightSpellEffectFactory.Load(fightCount));

            if (!FightSpellEffectFactory.isReady)
            {
                yield break;
            }
            yield return(FightUIFactory.Load());

            if (!FightUIFactory.isReady)
            {
                yield break;
            }
            UILoader <FightUIRework> loaderRework = new UILoader <FightUIRework>(this, "FightUIRework", "core/scenes/ui/fight");

            yield return(loaderRework.Load());

            m_uiRework = loaderRework.ui;
            m_uiRework.Init(GameStatus.fightType, m_fightDefinition);
            frame = new FightFrame
            {
                onOtherPlayerLeftFight = OnOtherPlayerLeftFight
            };
            if (m_hardResumed)
            {
                FightSnapshot snapshot = null;
                frame.onFightSnapshot = delegate(FightSnapshot fightSnapshot)
                {
                    snapshot = fightSnapshot;
                };
                frame.SendFightSnapshotRequest();
                while (snapshot == null)
                {
                    yield return(null);
                }
                frame.onFightSnapshot = null;
                yield return(ApplyFightSnapshot(snapshot));
            }
            frame.SendPlayerReady();
            while (!FightLogicExecutor.fightInitialized)
            {
                yield return(null);
            }
            yield return(uiRework.Load());
        }