From 592d43e59b0aa47997f357f70e51413737b54fba Mon Sep 17 00:00:00 2001 From: xbhuang1994 Date: Sat, 9 Jun 2018 17:16:10 +0800 Subject: [PATCH 1/3] Update README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加使用说明 --- README.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/README.md b/README.md index cf897d7..0fa83b8 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,47 @@ # nebulas-unity-sdk nebulas sdk to unity3d + +## 调用接口 + +#### 调用接口 call(): + + +> public static void Call(GoodsModel goods, String functionName, String to, String value, String[] args, String serialNumber) + +``` + public void CallTransfer() + { + var gmol = new GoodsModel(); + var serialNumber = Util.getRandomCode(32); + SmartContracts.Call(gmol, "vote", inputQueryTransfer.text, (Util.OnNAS * 0.000001).ToString("F0"), new string[] { "霸王别姬" }, serialNumber); + StartCoroutine(TransferStatusCoroutine(serialNumber)); + } + + public IEnumerator TransferStatusCoroutine(string serialNumber) + { + yield return new WaitForSeconds(1); + yield return SmartContracts.QueryTransferStatus(serialNumber, (success) => + { + Debug.Log(success); + TransferStatusHandler.Invoke(success); + }, (fail) => + { + Debug.LogError(fail); + TransferStatusErrorHandler.Invoke(fail); + }); + } +``` + +#### 调用接口 pay + +> public static void Pay(GoodsModel goods, String to, String value, String serialNumber) + + +#### 调用接口 queryTransferStatus() : + +> public static IEnumerator QueryTransferStatus(String serialNumber, Action onSuccess, Action onFail) + +### Examples + +> Nebulas>Examples>Simple + From 8722a27bf59dcfaf410f4de48095a6a8560fe821 Mon Sep 17 00:00:00 2001 From: xbhuang1994 Date: Sat, 9 Jun 2018 17:17:04 +0800 Subject: [PATCH 2/3] Update README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新布局 --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0fa83b8..c39d297 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ nebulas sdk to unity3d > public static void Call(GoodsModel goods, String functionName, String to, String value, String[] args, String serialNumber) ``` - public void CallTransfer() + public void CallTransfer() { var gmol = new GoodsModel(); var serialNumber = Util.getRandomCode(32); @@ -41,7 +41,8 @@ nebulas sdk to unity3d > public static IEnumerator QueryTransferStatus(String serialNumber, Action onSuccess, Action onFail) -### Examples + +## Examples > Nebulas>Examples>Simple From 061163aaac428d5a2e627ecc0e4f3aafec91eca8 Mon Sep 17 00:00:00 2001 From: xbhuang1994 Date: Sat, 9 Jun 2018 17:22:58 +0800 Subject: [PATCH 3/3] Update README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 调整readme内容 --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index c39d297..d46840e 100644 --- a/README.md +++ b/README.md @@ -46,3 +46,6 @@ nebulas sdk to unity3d > Nebulas>Examples>Simple +## 感谢社区 +#### 本工程处于测试中,如有问题或建议请fork代码后改正并提交,感谢您的支持与贡献。 +#### 工程实现参考于 Android SKD 项目:https://github.com/nebulasio/androidSDK