Ejemplo n.º 1
0
    public void ReadFromSourceUSBA()
    {
        uint offset = sbc.GetDefaultOffset();
        AutoInjector platformInjector;
#if UNITY_STANDALONE || UNITY_EDITOR
        platformInjector = usbInjector;
#else
        platformInjector = usbaInjector;
#endif
        platformInjector.SetWriteOffset(offset);
        platformInjector.ValidateEnabled = UI_Settings.GetValidateData();
        try
        {
            InjectionResult injectionResult = platformInjector.Read(true);
            if (injectionResult != InjectionResult.Success)
            {
                Debug.Log(injectionResult.ToString());
#if UNITY_STANDALONE || UNITY_EDITOR
                PopupHelper.CreateError(injectionResult.ToString(), 2f);
#endif
            }
        }
        catch (Exception ex)
        {
            Debug.LogError(ex.Message);
            UISB.ConnectedText.text = (ex.Message);
            UISB.SetConnected(false);
#if UNITY_STANDALONE || UNITY_EDITOR
            PopupHelper.CreateError(ex.Message, 2f);
#endif
        }
    }
Ejemplo n.º 2
0
 private void AfterRead(InjectionResult r)
 {
     if (r == InjectionResult.Success)
     {
         set(Items.ToArray());
     }
     else
     {
         Debug.LogError(r.ToString());
         PopupHelper.CreateError(r.ToString(), 2f);
     }
 }
Ejemplo n.º 3
0
    private void AfterRead(InjectionResult r)
    {
        if (r == InjectionResult.Success)
        {
            set(Items.ToArray());
        }
        else
        {
            Debug.LogError(r.ToString());
#if PLATFORM_ANDROID
            AndroidUSBUtils.CurrentInstance.DebugToast(r.ToString());
#endif
        }
    }
Ejemplo n.º 4
0
    public void WriteToSource()
    {
        uint offset = sbc.GetDefaultOffset();

        injector.SetWriteOffset(offset);
        try
        {
            InjectionResult injectionResult = injector.Write(true);
            if (injectionResult == InjectionResult.Success)
            {
                HappyParticles.gameObject.SetActive(true);
                HappyParticles.Stop();
                HappyParticles.Play();
            }
            else
            {
                Debug.Log(injectionResult.ToString());
            }
        }
        catch (Exception ex)
        {
            Debug.LogError(ex.Message);
            UISB.ConnectedText.text = (ex.Message);
            UISB.SetConnected(val: false);
        }
    }
Ejemplo n.º 5
0
    public void WriteToSource()
    {
        uint offset = sbc.GetDefaultOffset();

        injector.SetWriteOffset(offset);
        injector.ValidateEnabled = UI_Settings.GetValidateData();
        try
        {
            InjectionResult injectionResult = injector.Write(true);
            if (injectionResult == InjectionResult.Success)
            {
                PlayHappyParticles();
            }
            else
            {
                Debug.Log(injectionResult.ToString());
            }
        }
        catch (Exception ex)
        {
            Debug.LogError(ex.Message);
            UISB.ConnectedText.text = (ex.Message);
            UISB.SetConnected(val: false);
        }
    }
Ejemplo n.º 6
0
    public void ReadFromSource()
    {
        uint offset = sbc.GetDefaultOffset();

        injector.SetWriteOffset(offset);
        try
        {
            InjectionResult injectionResult = injector.Read(true);
            if (injectionResult != InjectionResult.Success)
            {
                Debug.Log(injectionResult.ToString());
            }
        }
        catch (Exception ex)
        {
            Debug.LogError(ex.Message);
            UISB.ConnectedText.text = (ex.Message);
            UISB.SetConnected(val: false);
        }
    }