WebGLSignMessageExample.cs 469 B

1234567891011121314151617181920212223
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. #if UNITY_WEBGL
  6. public class WebGLSignMessageExample : MonoBehaviour
  7. {
  8. async public void OnSignMessage()
  9. {
  10. try
  11. {
  12. string message = "hello";
  13. string response = await Web3GL.Sign(message);
  14. print(response);
  15. }
  16. catch (Exception e)
  17. {
  18. Debug.LogException(e, this);
  19. }
  20. }
  21. }
  22. #endif