/** * Either stop casting or open the list of detected cast devices. */ public void OnCastButtonTapped() { HideAll(); darkMask.SetActive(true); if (isCasting) { CastDevice selectedDevice = CastRemoteDisplayManager.GetInstance().GetSelectedCastDevice(); if (selectedDevice != null) { castDisconnectDialog.SetDeviceName(selectedDevice.DeviceName); } castDisconnectDialog.gameObject.SetActive(true); } else { CastError error = CastRemoteDisplayManager.GetInstance().GetLastError(); if (error == null) { darkMask.SetActive(true); castListDialog.Show(); } else { errorDialog.SetError(error); errorDialog.gameObject.SetActive(true); } } }
/** * Callback called from the native plugins when the SDK throws an error. */ public void _callback_OnCastError(string rawErrorString) { string errorString = extractErrorString(rawErrorString); CastErrorCode errorCode = extractErrorCode(rawErrorString); lastError = new CastError(errorCode, errorString); isCasting = false; onErrorCallback(); }
/** * Callback called from the native plugins when the SDK throws an error. */ public void _callback_OnCastError(string rawErrorString) { string errorString = extractErrorString(rawErrorString); CastErrorCode errorCode = extractErrorCode(rawErrorString); lastError = new CastError(errorCode, errorString); disconnect(); onErrorCallback(); }
public Skill PickSkill(Unit target, out CastError feedback) { foreach (var skill in unit.skillManager.skills) { if (skill.coolDownTimer <= 0 && skill.targeting == InteractionTargeting.unit) { feedback = skill.CheckCast(target); if (feedback == CastError.success || feedback == CastError.tooFar || feedback == CastError.tooNear) { return(skill); } } } feedback = CastError.wrongTarget; return(null); }
protected void EndCastRejected(CastError error) { switch (error) { case CastError.CurrentSkillNull: LogWarning("EndCast rejected!: Didn't start a cast (current skill is null)"); break; case CastError.NoControl: LogWarning("EndCast rejected!: No control over the character (probably crowd controlled)"); break; case CastError.CastSpeedHack: LogWarning("EndCast rejected!: Cast speed hack"); break; default: LogWarning("EndCast rejected!: " + error.ToString()); break; } InterruptCast(); }
protected virtual void OnDrop(CastError error) { }
/** * A function that will show the popup error dialog * @param title The title of the error dialog * @param message The message of the error */ public void showError (string title, string message) { // Create an error CastError error = new CastError (title, message); // Set the error errorDialog.SetError (error); // Show the error errorDialog.gameObject.SetActive (true); }
/** * When an error is thrown, set up the error dialog to display it when the Cast button is * pressed. */ public void SetError(CastError error) { titleLabel.text = error.ReadableErrorTitle; statusLabel.text = error.ReadableErrorBody; }
protected void InstantCastRejected(CastError error) { LogWarning("InstantCast rejected!: " + error.ToString()); currentSkill = null; }
protected void AdvanceCastRejected(CastError error) { LogWarning("AdvanceCast rejected!: " + error.ToString()); InterruptCast(); }