-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:xbhuang1994/nebulas-unity-sdk
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,51 @@ | ||
# 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<string> onSuccess, Action<string> onFail) | ||
|
||
## Examples | ||
|
||
> Nebulas>Examples>Simple | ||
## 感谢社区 | ||
#### 本工程处于测试中,如有问题或建议请fork代码后改正并提交,感谢您的支持与贡献。 | ||
#### 工程实现参考于 Android SKD 项目:https://github.com/nebulasio/androidSDK |