private void OnFightMapUserActionEnd(FightCastState state) { if (!(null == m_spellBeingCast)) { m_doneCasting = (state == FightCastState.DoneCasting); switch (state) { case FightCastState.Targeting: m_spellBeingCast.StartCast(); break; case FightCastState.Cancelled: m_spellBeingCast.CancelCast(); DragNDropListener.instance.CancelSnapDrag(); m_spellBeingCast = null; CleanCastHighlight(); break; case FightCastState.Casting: m_spellBeingCast.StartCast(); DragNDropListener.instance.CancelSnapDrag(); break; case FightCastState.DoneCasting: m_spellBeingCast.DoneCasting(); CleanCastHighlight(); m_spellsInDoneCasting.Add(m_spellBeingCast); m_spellBeingCast = null; break; default: throw new ArgumentOutOfRangeException("state", state, null); } } }
private void OnCastSpellDragEnd(SpellStatusCellRenderer cellRenderer, bool onTarget) { if (m_spellsInDoneCasting.Contains(cellRenderer)) { if (!m_doneCasting && !onTarget) { FightCastManager.StopCastingSpell(cancelled: true); } m_spellsInDoneCasting.Remove(cellRenderer); } }
public IEnumerator ShowPlaying(SpellStatus spell, CellObject cell) { if (m_spellDummyPool == null) { Log.Warning("PlaySpellCompanionUI is inactive.", 43, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\UI\\FightRework\\PlaySpellCompanionUI.cs"); yield break; } GameObject dummy = m_spellDummyPool.Instantiate(this.get_transform(), false); dummy.get_transform().set_localScale(m_spellDummy.get_transform().get_localScale()); SpellStatusCellRenderer itemUI = dummy.GetComponent <SpellStatusCellRenderer>(); CastableDragNDropElement dnd = dummy.GetComponent <CastableDragNDropElement>(); itemUI.SetValue(spell); yield return(itemUI.WaitForImage()); yield return(ShowPlaying(spell, dnd, cell)); itemUI.SetValue(null); m_spellDummyPool.Release(dummy); }
public void CastSpellDragEnd(SpellStatusCellRenderer spellStatusData, bool onTarget) { this.OnCastSpellDragEnd?.Invoke(spellStatusData, onTarget); }
public void CastSpellDragBegin(SpellStatusCellRenderer spellStatusData, bool click) { this.OnCastSpellDragBegin?.Invoke(spellStatusData, click); }
private void OnCastSpellDragBegin(SpellStatusCellRenderer spellStatus, bool click) { m_spellBeingCast = spellStatus; FightMap.current.SetTargetInputMode(click ? AbstractFightMap.TargetInputMode.Click : AbstractFightMap.TargetInputMode.Drag); FightCastManager.StartCastingSpell(m_playerStatus, (SpellStatus)spellStatus.value); }