public IEnumerator ShowPlaying(ReserveCompanionStatus companion, CellObject cell) { if (m_companionDummyPool == null) { Log.Warning("PlaySpellCompanionUI is inactive.", 64, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\UI\\FightRework\\PlaySpellCompanionUI.cs"); yield break; } GameObject dummy = m_companionDummyPool.Instantiate(this.get_transform(), false); dummy.get_transform().set_localScale(m_companionDummy.get_transform().get_localScale()); CompanionStatusCellRenderer itemUI = dummy.GetComponent <CompanionStatusCellRenderer>(); CastableDragNDropElement dnd = dummy.GetComponent <CastableDragNDropElement>(); itemUI.SetValue(companion); yield return(itemUI.WaitForImage()); yield return(ShowPlaying(companion, dnd, cell)); itemUI.SetValue(null); m_companionDummyPool.Release(dummy); }
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); }