Exemple #1
0
 /**
  * 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);
         }
     }
 }
Exemple #2
0
        /**
         * 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();
        }
Exemple #4
0
 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);
 }
Exemple #5
0
    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();
    }
Exemple #6
0
 protected virtual void OnDrop(CastError error)
 {
 }
 /**
  * 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();
 }
 /**
  * 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();
 }
	/**
	 * 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;
 }
Exemple #11
0
 protected void InstantCastRejected(CastError error)
 {
     LogWarning("InstantCast rejected!: " + error.ToString());
     currentSkill = null;
 }
Exemple #12
0
 protected void AdvanceCastRejected(CastError error)
 {
     LogWarning("AdvanceCast rejected!: " + error.ToString());
     InterruptCast();
 }
 /**
  * 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;
 }