Beispiel #1
0
        public CastHighlight CreateCastHighlight <T>(T item, Transform parent) where T : ICastableStatus
        {
            //IL_0067: Unknown result type (might be due to invalid IL or missing references)
            //IL_006d: Expected O, but got Unknown
            //IL_00a7: Unknown result type (might be due to invalid IL or missing references)
            ICastableDefinition definition    = item.GetDefinition();
            CastHighlight       castHighlight = GetCastHighlight(definition);

            if (castHighlight == null)
            {
                Log.Error(string.Format("No {0} prefab defined for {1}: {2}", "CastHighlight", item.GetType().Name, definition), 297, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\UI\\Fight\\Gauges\\FightUIFactory.cs");
                return(null);
            }
            if (!s_castHighlightPools.TryGetValue(castHighlight, out GameObjectPool value))
            {
                value = new GameObjectPool(castHighlight.get_gameObject());
                s_castHighlightPools.Add(castHighlight, value);
            }
            CastHighlight component = value.Instantiate(parent, true).GetComponent <CastHighlight>();

            if (component != null)
            {
                s_castHighlightInstances.Add(new KeyValuePair <CastHighlight, GameObjectPool>(component, value));
                component.get_transform().set_localPosition(Vector3.get_zero());
                component.Play();
            }
            return(component);
        }
 private void CleanCastHighlight()
 {
     if (m_castHighlight != null)
     {
         m_factory.DestroyCellHighlight(m_castHighlight);
         m_castHighlight = null;
     }
 }
 private void OnFightMapTargetChanged(bool hasTarget, CellObject cellObject)
 {
     //IL_0036: Unknown result type (might be due to invalid IL or missing references)
     if (!(m_companionBeingCast == null))
     {
         CleanCastHighlight();
         if (hasTarget && cellObject != null)
         {
             DragNDropListener.instance.SnapDragToWorldPosition(CameraHandler.current.camera, cellObject.get_transform().get_position());
             m_companionBeingCast.OnEnterTarget();
             m_castHighlight = m_factory.CreateCastHighlight((ReserveCompanionStatus)m_companionBeingCast.value, cellObject.highlight.get_transform());
         }
         else
         {
             DragNDropListener.instance.CancelSnapDrag();
             m_companionBeingCast.OnExitTarget();
         }
     }
 }
Beispiel #4
0
 public void DestroyCellHighlight(CastHighlight cellCastHighlight)
 {
     if (cellCastHighlight == null)
     {
         return;
     }
     cellCastHighlight.Stop();
     for (int num = s_castHighlightInstances.Count - 1; num >= 0; num--)
     {
         KeyValuePair <CastHighlight, GameObjectPool> keyValuePair = s_castHighlightInstances[num];
         if (keyValuePair.Key == cellCastHighlight)
         {
             s_castHighlightInstances.RemoveAt(num);
             keyValuePair.Value.Release(cellCastHighlight.get_gameObject());
             return;
         }
     }
     Log.Error("no pool found", cellCastHighlight, 337, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\UI\\Fight\\Gauges\\FightUIFactory.cs");
     Object.Destroy(cellCastHighlight.get_gameObject());
 }
Beispiel #5
0
        private IEnumerator ShowPlaying(ICastableStatus item, CastableDragNDropElement dnd, CellObject cell)
        {
            dnd.get_gameObject().SetActive(true);
            CastHighlight cellHighlight = m_factory.CreateCastHighlight(item, cell.highlight.get_transform());
            Vector3       worldPosition = FightUIRework.WorldToUIWorld(cell.highlight.get_transform().get_parent().get_position());
            Tween         tween         = dnd.PlayCastImmediate(worldPosition, m_fightUICanvas.get_transform());

            while (tween.get_active() && !TweenExtensions.IsComplete(tween))
            {
                yield return(null);
            }
            yield return((object)new WaitForTime(m_castingModeParameters.opponentPlayingDuration));

            m_factory.DestroyCellHighlight(cellHighlight);
            yield return((object)new WaitForTime(m_castingModeParameters.opponentCastPlayingDuration));

            Tween endCastImmediate = dnd.EndCastImmediate();

            while (endCastImmediate.get_active() && !TweenExtensions.IsComplete(endCastImmediate))
            {
                yield return(null);
            }
            dnd.get_gameObject().SetActive(false);
        }