Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "统一全部Demo引擎与插件版本, 更新api_v2 中的tcp和游戏圈demo展示" #813

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion Demo/API_V2/Assets/API/APISO.asset
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ MonoBehaviour:
- {fileID: 11400000, guid: 9977a581037b84833a32b508e00eb1a2, type: 2}
- {fileID: 11400000, guid: 56f316e0e10ba419bbf19bd7a68bfc4c, type: 2}
- {fileID: 11400000, guid: 6f0972f5fdc56c543b23c9873d760bf5, type: 2}
- {fileID: 11400000, guid: 7ef06699cee7846b7823e4cc421418eb, type: 2}
- {fileID: 11400000, guid: a461b8cd70d9e4e23ad1cc953bec31e9, type: 2}
- {fileID: 11400000, guid: 7ef06699cee7846b7823e4cc421418eb, type: 2}
- {fileID: 11400000, guid: 55de20d536f8c4689bbd80553d87fe46, type: 2}
- {fileID: 11400000, guid: f2c56d751bb7c4c398db7c1db352517d, type: 2}
- {fileID: 11400000, guid: b4a6196f623dd4435a4f3bd70af92d06, type: 2}
Expand Down
2 changes: 1 addition & 1 deletion Demo/API_V2/Assets/API/DataStorage/DataStorageSO.asset
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ MonoBehaviour:
m_Name: DataStorageSO
m_EditorClassIdentifier:
categoryName: "\u6570\u636E\u7F13\u5B58"
categorySprite: {fileID: 21300000, guid: aedb8ebe6c4a14a13b23dc2e9ab42dcf, type: 3}
categorySprite: {fileID: 0}
entryList:
- {fileID: 11400000, guid: a587889226c1f491fa6c783db1e12837, type: 2}
4 changes: 2 additions & 2 deletions Demo/API_V2/Assets/API/Facility/FacilitySO.asset
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ MonoBehaviour:
categoryName: "\u8BBE\u5907"
categorySprite: {fileID: 21300000, guid: fcbb6947b033746dabecaec0f84b0434, type: 3}
entryList:
- {fileID: 11400000, guid: a24af43ae51914d26b0bf637c283dab2, type: 2}
- {fileID: 11400000, guid: 4eba2c9f2f2064e4081be74302ca4c33, type: 2}
- {fileID: 11400000, guid: bbbc9b983d6d34ad3bac2921509f612f, type: 2}
- {fileID: 11400000, guid: c17ae0ce755f04419b700825b20fd386, type: 2}
- {fileID: 11400000, guid: a24af43ae51914d26b0bf637c283dab2, type: 2}
- {fileID: 11400000, guid: 4eba2c9f2f2064e4081be74302ca4c33, type: 2}
- {fileID: 11400000, guid: ac09abff5d8bc48bbabd08bde820b58b, type: 2}
- {fileID: 11400000, guid: 3bf339b994c544db3860ddf0a0dc8e20, type: 2}
- {fileID: 11400000, guid: e92d94924be504167a342e42e1162f21, type: 2}
Expand Down
2 changes: 1 addition & 1 deletion Demo/API_V2/Assets/API/FileSystem/FileSystemSO.asset
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ MonoBehaviour:
- {fileID: 11400000, guid: 65ab1b01a722b4542a14fcf9decca3de, type: 2}
- {fileID: 11400000, guid: 19b80cb144f0c4ea28a4ddca7a2c2f09, type: 2}
- {fileID: 11400000, guid: 0aa5d76237c844275add1612c47bddaa, type: 2}
- {fileID: 11400000, guid: 65a826f5f949544d8990e673231bb80f, type: 2}
- {fileID: 11400000, guid: 73c05fc1ffae94ec1b69a00ee261d529, type: 2}
- {fileID: 11400000, guid: 65a826f5f949544d8990e673231bb80f, type: 2}
- {fileID: 11400000, guid: 3a901e80b59ad4aafbe373ee6a8df2d8, type: 2}
- {fileID: 11400000, guid: e7ea0be62dc6543b0a8dc629489c5e7e, type: 2}
2 changes: 1 addition & 1 deletion Demo/API_V2/Assets/API/GUI/GUISO.asset
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ MonoBehaviour:
m_Name: GUISO
m_EditorClassIdentifier:
categoryName: "\u754C\u9762"
categorySprite: {fileID: 21300000, guid: bd5165d5d0b9b4f55b39dce7f4638c81, type: 3}
categorySprite: {fileID: 0}
entryList:
- {fileID: 11400000, guid: 546628e39e8c246c38eebcdfbfd35b47, type: 2}
- {fileID: 11400000, guid: 6902bd974e09745c4a185485a99c165d, type: 2}
Expand Down
4 changes: 2 additions & 2 deletions Demo/API_V2/Assets/API/Network/NetworkSO.asset
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4a9e19ed69c041c408533b50f5572d0f, type: 3}
m_Name: NetworkSO
m_EditorClassIdentifier:
categoryName: "\u7F51\u7EDC"
categorySprite: {fileID: 21300000, guid: bb0b97758d57042a296e1ecd925f8088, type: 3}
categoryName: "\u4E0B\u8F7D"
categorySprite: {fileID: 0}
entryList:
- {fileID: 11400000, guid: 8fb54c5918d454eea90d5147f2c316ea, type: 2}
- {fileID: 11400000, guid: 1e0539509d074443f92d17035efbe40f, type: 2}
Expand Down
114 changes: 22 additions & 92 deletions Demo/API_V2/Assets/API/Network/TCPSocket/TCPSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,114 +6,44 @@
public class TCPSocket : Details
{
private WXTCPSocket _tcpSocket;
private bool _connected = false;

// 数据
private string _stringData1 = "String Data";
private string _stringData2 = "123\n";


private byte[] _bufferData1 = { 66, 117, 102, 102, 101, 114, 32, 68, 97, 116, 97, 32 };
private byte[] _bufferData2 = { 0xab, 0x05, 0xd7, 0x05 };
private byte[] _bufferData3 = new byte[8];

private void Start() {
GameManager.Instance.detailsController.BindExtraButtonAction(0, connect);
GameManager.Instance.detailsController.BindExtraButtonAction(1, write);
GameManager.Instance.detailsController.BindExtraButtonAction(2, writeBuffer);
GameManager.Instance.detailsController.BindExtraButtonAction(3, close);
GameManager.Instance.detailsController.BindExtraButtonAction(0, connect);
GameManager.Instance.detailsController.BindExtraButtonAction(1, close);
}

// 测试 API
protected override void TestAPI(string[] args)
{
if(_tcpSocket == null)
{
_tcpSocket = WX.CreateTCPSocket();
Debug.Log("tcpSocket: " + JsonUtility.ToJson(_tcpSocket));
_tcpSocket = WX.CreateTCPSocket();
Debug.Log("tcpSocket: " + JsonUtility.ToJson(_tcpSocket));

_tcpSocket.OnMessage((res) => {
Debug.Log("onMessage: " + JsonUtility.ToJson(res));
});
_tcpSocket.OnConnect((res) => {
Debug.Log("onConnect: " + JsonUtility.ToJson(res));
});

_tcpSocket.OnConnect((res) => {
Debug.Log("onConnect: " + JsonUtility.ToJson(res));
});
_tcpSocket.OnError((res) => {
Debug.Log("onError: " + JsonUtility.ToJson(res));
});

_tcpSocket.OnError((res) => {
Debug.Log("onError: " + JsonUtility.ToJson(res));
});
_tcpSocket.OnClose((res) => {
Debug.Log("onClose: " + JsonUtility.ToJson(res));
});

_tcpSocket.OnClose((res) => {
Debug.Log("onClose: " + JsonUtility.ToJson(res));
});
} else
{
Debug.Log("tcp实例已初始化");
}

_tcpSocket.OnMessage((res) => {
Debug.Log("onMessage: " + JsonUtility.ToJson(res));
});
}

private void close()
{
if(_tcpSocket != null && _connected)
{
Debug.Log("close test start");
_tcpSocket.Close();
_connected = false;
} else
{
Debug.Log("关闭失败:tcp实例未初始化或未连接");
}

}


private void connect() {
if (_tcpSocket != null && !_connected) {
Debug.Log("connect test start");
_tcpSocket.Connect(new TCPSocketConnectOption()
{
address = "www.oooceanworld.com",
port = 8101
});
_connected = true;
} else
{
Debug.Log("连接失败:tcp实例未初始化或已连接");
}
}

private void write() {
if (_tcpSocket != null && _connected)
{
Debug.Log("write string test start:");
Debug.Log("test 1: " + _stringData1);
_tcpSocket.Write(_stringData1);
Debug.Log("test 2: " + _stringData2);
_tcpSocket.Write(_stringData2);
} else
{
Debug.Log("发送失败:tcp实例未初始化或未连接");
}

_tcpSocket.Connect(new TCPSocketConnectOption() {
address = "192.168.193.2",
port = 8848
});
}

private void writeBuffer() {
if (_tcpSocket != null && _connected)
{
Debug.Log("write buffer test start:");
Debug.Log("test 1: " + _bufferData1);
_tcpSocket.Write(_bufferData1);
Debug.Log("test 2: " + _bufferData2);
_tcpSocket.Write(_bufferData2);
Debug.Log("test 3: " + _bufferData3);
_tcpSocket.Write(_bufferData3);
}
else
{
Debug.Log("发送失败:tcp实例未初始化或未连接");
}
private void close() {
_tcpSocket.Close();
}
}

2 changes: 0 additions & 2 deletions Demo/API_V2/Assets/API/Network/TCPSocket/TCPSocketSO.asset
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,5 @@ MonoBehaviour:
initialButtonText: "\u521B\u5EFAtcp\u5B9E\u4F8B"
extraButtonList:
- buttonText: "\u8FDE\u63A5"
- buttonText: "\u53D1\u9001String"
- buttonText: "\u53D1\u9001Buffer"
- buttonText: "\u5173\u95ED"
initialResultList: []
23 changes: 0 additions & 23 deletions Demo/API_V2/Assets/API/OpenInterface/GameClub/GameClub SO.asset

This file was deleted.

121 changes: 0 additions & 121 deletions Demo/API_V2/Assets/API/OpenInterface/GameClub/GameClub.cs

This file was deleted.

3 changes: 1 addition & 2 deletions Demo/API_V2/Assets/API/OpenInterface/OpenInterfaceSO.asset
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ MonoBehaviour:
m_Name: OpenInterfaceSO
m_EditorClassIdentifier:
categoryName: "\u5F00\u653E\u63A5\u53E3"
categorySprite: {fileID: 21300000, guid: 655a4cabb9e794434b9c028267c63e10, type: 3}
categorySprite: {fileID: 0}
entryList:
- {fileID: 11400000, guid: d0c8de90644082f418ae2ec91900bd8f, type: 2}
- {fileID: 11400000, guid: 8a4f679875fb6413b9b0df39d1359e57, type: 2}
- {fileID: 11400000, guid: 2957939a29ac24a2e9ca1d4f6ccdb41e, type: 2}
- {fileID: 11400000, guid: 2c8c997508e96423fa1031b948386d44, type: 2}
Expand Down
Loading
Loading