private void OnFightMapUserActionEnd(FightCastState state) { if (!(null == m_companionBeingCast)) { switch (state) { case FightCastState.Targeting: m_companionBeingCast.StartCast(); break; case FightCastState.Cancelled: m_companionBeingCast.CancelCast(); DragNDropListener.instance.CancelSnapDrag(); m_companionBeingCast = null; CleanCastHighlight(); break; case FightCastState.Casting: m_companionBeingCast.StartCast(); DragNDropListener.instance.CancelSnapDrag(); break; case FightCastState.DoneCasting: m_companionBeingCast.DoneCasting(); m_companionBeingCast = null; CleanCastHighlight(); break; default: throw new ArgumentOutOfRangeException("state", state, null); } } }
private void OnCastCompanionDragEnd(CompanionStatusCellRenderer cellRenderer, bool onTarget) { if (!(m_companionBeingCast == null)) { m_companionBeingCast = null; if (!onTarget) { FightCastManager.StopInvokingCompanion(cancelled: true); } } }
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); }
public void CastCompanionDragEnd(CompanionStatusCellRenderer statusData, bool onTarget) { this.OnCastCompanionDragEnd?.Invoke(statusData, onTarget); }
public void CastCompanionDragBegin(CompanionStatusCellRenderer statusData, bool click) { this.OnCastCompanionDragBegin?.Invoke(statusData, click); }
private void OnCastCompanionDragBegin(CompanionStatusCellRenderer cellRenderer, bool click) { m_companionBeingCast = cellRenderer; FightMap.current.SetTargetInputMode(click ? AbstractFightMap.TargetInputMode.Click : AbstractFightMap.TargetInputMode.Drag); FightCastManager.StartInvokingCompanion(m_playerStatus, (ReserveCompanionStatus)cellRenderer.value); }