增加了common文件夹
This commit is contained in:
parent
df819a7e54
commit
358701471d
@ -1,281 +0,0 @@
|
||||
// <auto-generated>
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: common.proto
|
||||
// </auto-generated>
|
||||
#pragma warning disable 1591, 0612, 3021, 8981
|
||||
#region Designer generated code
|
||||
|
||||
using pb = global::Google.Protobuf;
|
||||
using pbc = global::Google.Protobuf.Collections;
|
||||
using pbr = global::Google.Protobuf.Reflection;
|
||||
using scg = global::System.Collections.Generic;
|
||||
/// <summary>Holder for reflection information generated from common.proto</summary>
|
||||
public static partial class CommonReflection {
|
||||
|
||||
#region Descriptor
|
||||
/// <summary>File descriptor for common.proto</summary>
|
||||
public static pbr::FileDescriptor Descriptor {
|
||||
get { return descriptor; }
|
||||
}
|
||||
private static pbr::FileDescriptor descriptor;
|
||||
|
||||
static CommonReflection() {
|
||||
byte[] descriptorData = global::System.Convert.FromBase64String(
|
||||
string.Concat(
|
||||
"Cgxjb21tb24ucHJvdG8iLgoNUmVzdWx0TWVzc2FnZRIMCgRjb2RlGAEgASgF",
|
||||
"Eg8KB21lc3NhZ2UYAiABKAlCB1oFLi87cGJiBnByb3RvMw=="));
|
||||
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
|
||||
new pbr::FileDescriptor[] { },
|
||||
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
|
||||
new pbr::GeneratedClrTypeInfo(typeof(global::ResultMessage), global::ResultMessage.Parser, new[]{ "Code", "Message" }, null, null, null, null)
|
||||
}));
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
#region Messages
|
||||
[global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
|
||||
public sealed partial class ResultMessage : pb::IMessage<ResultMessage>
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
, pb::IBufferMessage
|
||||
#endif
|
||||
{
|
||||
private static readonly pb::MessageParser<ResultMessage> _parser = new pb::MessageParser<ResultMessage>(() => new ResultMessage());
|
||||
private pb::UnknownFieldSet _unknownFields;
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public static pb::MessageParser<ResultMessage> Parser { get { return _parser; } }
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public static pbr::MessageDescriptor Descriptor {
|
||||
get { return global::CommonReflection.Descriptor.MessageTypes[0]; }
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
pbr::MessageDescriptor pb::IMessage.Descriptor {
|
||||
get { return Descriptor; }
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public ResultMessage() {
|
||||
OnConstruction();
|
||||
}
|
||||
|
||||
partial void OnConstruction();
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public ResultMessage(ResultMessage other) : this() {
|
||||
code_ = other.code_;
|
||||
message_ = other.message_;
|
||||
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public ResultMessage Clone() {
|
||||
return new ResultMessage(this);
|
||||
}
|
||||
|
||||
/// <summary>Field number for the "code" field.</summary>
|
||||
public const int CodeFieldNumber = 1;
|
||||
private int code_;
|
||||
/// <summary>
|
||||
/// 错误码
|
||||
/// </summary>
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public int Code {
|
||||
get { return code_; }
|
||||
set {
|
||||
code_ = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Field number for the "message" field.</summary>
|
||||
public const int MessageFieldNumber = 2;
|
||||
private string message_ = "";
|
||||
/// <summary>
|
||||
/// 错误信息
|
||||
/// </summary>
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public string Message {
|
||||
get { return message_; }
|
||||
set {
|
||||
message_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public override bool Equals(object other) {
|
||||
return Equals(other as ResultMessage);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public bool Equals(ResultMessage other) {
|
||||
if (ReferenceEquals(other, null)) {
|
||||
return false;
|
||||
}
|
||||
if (ReferenceEquals(other, this)) {
|
||||
return true;
|
||||
}
|
||||
if (Code != other.Code) return false;
|
||||
if (Message != other.Message) return false;
|
||||
return Equals(_unknownFields, other._unknownFields);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public override int GetHashCode() {
|
||||
int hash = 1;
|
||||
if (Code != 0) hash ^= Code.GetHashCode();
|
||||
if (Message.Length != 0) hash ^= Message.GetHashCode();
|
||||
if (_unknownFields != null) {
|
||||
hash ^= _unknownFields.GetHashCode();
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public override string ToString() {
|
||||
return pb::JsonFormatter.ToDiagnosticString(this);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public void WriteTo(pb::CodedOutputStream output) {
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
output.WriteRawMessage(this);
|
||||
#else
|
||||
if (Code != 0) {
|
||||
output.WriteRawTag(8);
|
||||
output.WriteInt32(Code);
|
||||
}
|
||||
if (Message.Length != 0) {
|
||||
output.WriteRawTag(18);
|
||||
output.WriteString(Message);
|
||||
}
|
||||
if (_unknownFields != null) {
|
||||
_unknownFields.WriteTo(output);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
|
||||
if (Code != 0) {
|
||||
output.WriteRawTag(8);
|
||||
output.WriteInt32(Code);
|
||||
}
|
||||
if (Message.Length != 0) {
|
||||
output.WriteRawTag(18);
|
||||
output.WriteString(Message);
|
||||
}
|
||||
if (_unknownFields != null) {
|
||||
_unknownFields.WriteTo(ref output);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public int CalculateSize() {
|
||||
int size = 0;
|
||||
if (Code != 0) {
|
||||
size += 1 + pb::CodedOutputStream.ComputeInt32Size(Code);
|
||||
}
|
||||
if (Message.Length != 0) {
|
||||
size += 1 + pb::CodedOutputStream.ComputeStringSize(Message);
|
||||
}
|
||||
if (_unknownFields != null) {
|
||||
size += _unknownFields.CalculateSize();
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public void MergeFrom(ResultMessage other) {
|
||||
if (other == null) {
|
||||
return;
|
||||
}
|
||||
if (other.Code != 0) {
|
||||
Code = other.Code;
|
||||
}
|
||||
if (other.Message.Length != 0) {
|
||||
Message = other.Message;
|
||||
}
|
||||
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public void MergeFrom(pb::CodedInputStream input) {
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
input.ReadRawMessage(this);
|
||||
#else
|
||||
uint tag;
|
||||
while ((tag = input.ReadTag()) != 0) {
|
||||
if ((tag & 7) == 4) {
|
||||
// Abort on any end group tag.
|
||||
return;
|
||||
}
|
||||
switch(tag) {
|
||||
default:
|
||||
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
|
||||
break;
|
||||
case 8: {
|
||||
Code = input.ReadInt32();
|
||||
break;
|
||||
}
|
||||
case 18: {
|
||||
Message = input.ReadString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
|
||||
uint tag;
|
||||
while ((tag = input.ReadTag()) != 0) {
|
||||
if ((tag & 7) == 4) {
|
||||
// Abort on any end group tag.
|
||||
return;
|
||||
}
|
||||
switch(tag) {
|
||||
default:
|
||||
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
|
||||
break;
|
||||
case 8: {
|
||||
Code = input.ReadInt32();
|
||||
break;
|
||||
}
|
||||
case 18: {
|
||||
Message = input.ReadString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#endregion Designer generated code
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8f08a6ce1ce72944ab924e71bac47c6f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,83 +0,0 @@
|
||||
// <auto-generated>
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: config.proto
|
||||
// </auto-generated>
|
||||
#pragma warning disable 1591, 0612, 3021, 8981
|
||||
#region Designer generated code
|
||||
|
||||
using pb = global::Google.Protobuf;
|
||||
using pbc = global::Google.Protobuf.Collections;
|
||||
using pbr = global::Google.Protobuf.Reflection;
|
||||
using scg = global::System.Collections.Generic;
|
||||
/// <summary>Holder for reflection information generated from config.proto</summary>
|
||||
public static partial class ConfigReflection {
|
||||
|
||||
#region Descriptor
|
||||
/// <summary>File descriptor for config.proto</summary>
|
||||
public static pbr::FileDescriptor Descriptor {
|
||||
get { return descriptor; }
|
||||
}
|
||||
private static pbr::FileDescriptor descriptor;
|
||||
|
||||
static ConfigReflection() {
|
||||
byte[] descriptorData = global::System.Convert.FromBase64String(
|
||||
string.Concat(
|
||||
"Cgxjb25maWcucHJvdG8qnQEKCkVSUk9SX0NPREUSCgoGRVJSX09rEAASEAoM",
|
||||
"RVJSX05vUGxheWVyEAESDgoKRVJSX05vUm9vbRACEg0KCUVSUl9Ub2tlbhAE",
|
||||
"Eg0KCUVSUl9Mb2dpbhAFEg4KCkVSUl9BY3Rpb24QBhIOCgpFUlJfUGFyYW1z",
|
||||
"EAcSDgoKRVJSX1NlcnZlchAIEhMKD0VSUl9Ob0F1dGhvcml0eRAJQgdaBS4v",
|
||||
"O3BiYgZwcm90bzM="));
|
||||
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
|
||||
new pbr::FileDescriptor[] { },
|
||||
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::ERROR_CODE), }, null, null));
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
#region Enums
|
||||
/// <summary>
|
||||
///错误码
|
||||
/// </summary>
|
||||
public enum ERROR_CODE {
|
||||
/// <summary>
|
||||
///OK
|
||||
/// </summary>
|
||||
[pbr::OriginalName("ERR_Ok")] ErrOk = 0,
|
||||
/// <summary>
|
||||
///没有这个玩家
|
||||
/// </summary>
|
||||
[pbr::OriginalName("ERR_NoPlayer")] ErrNoPlayer = 1,
|
||||
/// <summary>
|
||||
///加入房间失败
|
||||
/// </summary>
|
||||
[pbr::OriginalName("ERR_NoRoom")] ErrNoRoom = 2,
|
||||
/// <summary>
|
||||
///Token验证失败
|
||||
/// </summary>
|
||||
[pbr::OriginalName("ERR_Token")] ErrToken = 4,
|
||||
/// <summary>
|
||||
///登录失败
|
||||
/// </summary>
|
||||
[pbr::OriginalName("ERR_Login")] ErrLogin = 5,
|
||||
/// <summary>
|
||||
///操作失败
|
||||
/// </summary>
|
||||
[pbr::OriginalName("ERR_Action")] ErrAction = 6,
|
||||
/// <summary>
|
||||
///参数错误
|
||||
/// </summary>
|
||||
[pbr::OriginalName("ERR_Params")] ErrParams = 7,
|
||||
/// <summary>
|
||||
///服务器内部错误
|
||||
/// </summary>
|
||||
[pbr::OriginalName("ERR_Server")] ErrServer = 8,
|
||||
/// <summary>
|
||||
///没有权限
|
||||
/// </summary>
|
||||
[pbr::OriginalName("ERR_NoAuthority")] ErrNoAuthority = 9,
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#endregion Designer generated code
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6249125b6bd7a964aa825c041b9cab82
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 013d659005f08544cafe01b5a18e6072
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 63abcfa0f6080534d8642cfb5eae1ac0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,525 +0,0 @@
|
||||
// <auto-generated>
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: message_broadcast.proto
|
||||
// </auto-generated>
|
||||
#pragma warning disable 1591, 0612, 3021, 8981
|
||||
#region Designer generated code
|
||||
|
||||
using pb = global::Google.Protobuf;
|
||||
using pbc = global::Google.Protobuf.Collections;
|
||||
using pbr = global::Google.Protobuf.Reflection;
|
||||
using scg = global::System.Collections.Generic;
|
||||
/// <summary>Holder for reflection information generated from message_broadcast.proto</summary>
|
||||
public static partial class MessageBroadcastReflection {
|
||||
|
||||
#region Descriptor
|
||||
/// <summary>File descriptor for message_broadcast.proto</summary>
|
||||
public static pbr::FileDescriptor Descriptor {
|
||||
get { return descriptor; }
|
||||
}
|
||||
private static pbr::FileDescriptor descriptor;
|
||||
|
||||
static MessageBroadcastReflection() {
|
||||
byte[] descriptorData = global::System.Convert.FromBase64String(
|
||||
string.Concat(
|
||||
"ChdtZXNzYWdlX2Jyb2FkY2FzdC5wcm90byJUChdNZXNzYWdlQnJvYWRjYXN0",
|
||||
"UmVxdWVzdBIOCgZyb29tSWQYASABKAkSDAoEdHlwZRgCIAEoBRIOCgZyb2xl",
|
||||
"SWQYAyABKAkSCwoDY21kGAQgASgJIhoKGE1lc3NhZ2VCcm9hZGNhc3RSZXNw",
|
||||
"b25zZUIHWgUuLztwYmIGcHJvdG8z"));
|
||||
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
|
||||
new pbr::FileDescriptor[] { },
|
||||
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
|
||||
new pbr::GeneratedClrTypeInfo(typeof(global::MessageBroadcastRequest), global::MessageBroadcastRequest.Parser, new[]{ "RoomId", "Type", "RoleId", "Cmd" }, null, null, null, null),
|
||||
new pbr::GeneratedClrTypeInfo(typeof(global::MessageBroadcastResponse), global::MessageBroadcastResponse.Parser, null, null, null, null, null)
|
||||
}));
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
#region Messages
|
||||
[global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
|
||||
public sealed partial class MessageBroadcastRequest : pb::IMessage<MessageBroadcastRequest>
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
, pb::IBufferMessage
|
||||
#endif
|
||||
{
|
||||
private static readonly pb::MessageParser<MessageBroadcastRequest> _parser = new pb::MessageParser<MessageBroadcastRequest>(() => new MessageBroadcastRequest());
|
||||
private pb::UnknownFieldSet _unknownFields;
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public static pb::MessageParser<MessageBroadcastRequest> Parser { get { return _parser; } }
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public static pbr::MessageDescriptor Descriptor {
|
||||
get { return global::MessageBroadcastReflection.Descriptor.MessageTypes[0]; }
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
pbr::MessageDescriptor pb::IMessage.Descriptor {
|
||||
get { return Descriptor; }
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public MessageBroadcastRequest() {
|
||||
OnConstruction();
|
||||
}
|
||||
|
||||
partial void OnConstruction();
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public MessageBroadcastRequest(MessageBroadcastRequest other) : this() {
|
||||
roomId_ = other.roomId_;
|
||||
type_ = other.type_;
|
||||
roleId_ = other.roleId_;
|
||||
cmd_ = other.cmd_;
|
||||
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public MessageBroadcastRequest Clone() {
|
||||
return new MessageBroadcastRequest(this);
|
||||
}
|
||||
|
||||
/// <summary>Field number for the "roomId" field.</summary>
|
||||
public const int RoomIdFieldNumber = 1;
|
||||
private string roomId_ = "";
|
||||
/// <summary>
|
||||
/// 房间id
|
||||
/// </summary>
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public string RoomId {
|
||||
get { return roomId_; }
|
||||
set {
|
||||
roomId_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Field number for the "type" field.</summary>
|
||||
public const int TypeFieldNumber = 2;
|
||||
private int type_;
|
||||
/// <summary>
|
||||
/// 消息类型 1. 文本 2. 图片 3. 语音 4. 视频
|
||||
/// </summary>
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public int Type {
|
||||
get { return type_; }
|
||||
set {
|
||||
type_ = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Field number for the "roleId" field.</summary>
|
||||
public const int RoleIdFieldNumber = 3;
|
||||
private string roleId_ = "";
|
||||
/// <summary>
|
||||
/// 角色Id 如果为空就是给所有人发
|
||||
/// </summary>
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public string RoleId {
|
||||
get { return roleId_; }
|
||||
set {
|
||||
roleId_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Field number for the "cmd" field.</summary>
|
||||
public const int CmdFieldNumber = 4;
|
||||
private string cmd_ = "";
|
||||
/// <summary>
|
||||
/// 自定义命令
|
||||
/// </summary>
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public string Cmd {
|
||||
get { return cmd_; }
|
||||
set {
|
||||
cmd_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public override bool Equals(object other) {
|
||||
return Equals(other as MessageBroadcastRequest);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public bool Equals(MessageBroadcastRequest other) {
|
||||
if (ReferenceEquals(other, null)) {
|
||||
return false;
|
||||
}
|
||||
if (ReferenceEquals(other, this)) {
|
||||
return true;
|
||||
}
|
||||
if (RoomId != other.RoomId) return false;
|
||||
if (Type != other.Type) return false;
|
||||
if (RoleId != other.RoleId) return false;
|
||||
if (Cmd != other.Cmd) return false;
|
||||
return Equals(_unknownFields, other._unknownFields);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public override int GetHashCode() {
|
||||
int hash = 1;
|
||||
if (RoomId.Length != 0) hash ^= RoomId.GetHashCode();
|
||||
if (Type != 0) hash ^= Type.GetHashCode();
|
||||
if (RoleId.Length != 0) hash ^= RoleId.GetHashCode();
|
||||
if (Cmd.Length != 0) hash ^= Cmd.GetHashCode();
|
||||
if (_unknownFields != null) {
|
||||
hash ^= _unknownFields.GetHashCode();
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public override string ToString() {
|
||||
return pb::JsonFormatter.ToDiagnosticString(this);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public void WriteTo(pb::CodedOutputStream output) {
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
output.WriteRawMessage(this);
|
||||
#else
|
||||
if (RoomId.Length != 0) {
|
||||
output.WriteRawTag(10);
|
||||
output.WriteString(RoomId);
|
||||
}
|
||||
if (Type != 0) {
|
||||
output.WriteRawTag(16);
|
||||
output.WriteInt32(Type);
|
||||
}
|
||||
if (RoleId.Length != 0) {
|
||||
output.WriteRawTag(26);
|
||||
output.WriteString(RoleId);
|
||||
}
|
||||
if (Cmd.Length != 0) {
|
||||
output.WriteRawTag(34);
|
||||
output.WriteString(Cmd);
|
||||
}
|
||||
if (_unknownFields != null) {
|
||||
_unknownFields.WriteTo(output);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
|
||||
if (RoomId.Length != 0) {
|
||||
output.WriteRawTag(10);
|
||||
output.WriteString(RoomId);
|
||||
}
|
||||
if (Type != 0) {
|
||||
output.WriteRawTag(16);
|
||||
output.WriteInt32(Type);
|
||||
}
|
||||
if (RoleId.Length != 0) {
|
||||
output.WriteRawTag(26);
|
||||
output.WriteString(RoleId);
|
||||
}
|
||||
if (Cmd.Length != 0) {
|
||||
output.WriteRawTag(34);
|
||||
output.WriteString(Cmd);
|
||||
}
|
||||
if (_unknownFields != null) {
|
||||
_unknownFields.WriteTo(ref output);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public int CalculateSize() {
|
||||
int size = 0;
|
||||
if (RoomId.Length != 0) {
|
||||
size += 1 + pb::CodedOutputStream.ComputeStringSize(RoomId);
|
||||
}
|
||||
if (Type != 0) {
|
||||
size += 1 + pb::CodedOutputStream.ComputeInt32Size(Type);
|
||||
}
|
||||
if (RoleId.Length != 0) {
|
||||
size += 1 + pb::CodedOutputStream.ComputeStringSize(RoleId);
|
||||
}
|
||||
if (Cmd.Length != 0) {
|
||||
size += 1 + pb::CodedOutputStream.ComputeStringSize(Cmd);
|
||||
}
|
||||
if (_unknownFields != null) {
|
||||
size += _unknownFields.CalculateSize();
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public void MergeFrom(MessageBroadcastRequest other) {
|
||||
if (other == null) {
|
||||
return;
|
||||
}
|
||||
if (other.RoomId.Length != 0) {
|
||||
RoomId = other.RoomId;
|
||||
}
|
||||
if (other.Type != 0) {
|
||||
Type = other.Type;
|
||||
}
|
||||
if (other.RoleId.Length != 0) {
|
||||
RoleId = other.RoleId;
|
||||
}
|
||||
if (other.Cmd.Length != 0) {
|
||||
Cmd = other.Cmd;
|
||||
}
|
||||
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public void MergeFrom(pb::CodedInputStream input) {
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
input.ReadRawMessage(this);
|
||||
#else
|
||||
uint tag;
|
||||
while ((tag = input.ReadTag()) != 0) {
|
||||
if ((tag & 7) == 4) {
|
||||
// Abort on any end group tag.
|
||||
return;
|
||||
}
|
||||
switch(tag) {
|
||||
default:
|
||||
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
|
||||
break;
|
||||
case 10: {
|
||||
RoomId = input.ReadString();
|
||||
break;
|
||||
}
|
||||
case 16: {
|
||||
Type = input.ReadInt32();
|
||||
break;
|
||||
}
|
||||
case 26: {
|
||||
RoleId = input.ReadString();
|
||||
break;
|
||||
}
|
||||
case 34: {
|
||||
Cmd = input.ReadString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
|
||||
uint tag;
|
||||
while ((tag = input.ReadTag()) != 0) {
|
||||
if ((tag & 7) == 4) {
|
||||
// Abort on any end group tag.
|
||||
return;
|
||||
}
|
||||
switch(tag) {
|
||||
default:
|
||||
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
|
||||
break;
|
||||
case 10: {
|
||||
RoomId = input.ReadString();
|
||||
break;
|
||||
}
|
||||
case 16: {
|
||||
Type = input.ReadInt32();
|
||||
break;
|
||||
}
|
||||
case 26: {
|
||||
RoleId = input.ReadString();
|
||||
break;
|
||||
}
|
||||
case 34: {
|
||||
Cmd = input.ReadString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
|
||||
public sealed partial class MessageBroadcastResponse : pb::IMessage<MessageBroadcastResponse>
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
, pb::IBufferMessage
|
||||
#endif
|
||||
{
|
||||
private static readonly pb::MessageParser<MessageBroadcastResponse> _parser = new pb::MessageParser<MessageBroadcastResponse>(() => new MessageBroadcastResponse());
|
||||
private pb::UnknownFieldSet _unknownFields;
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public static pb::MessageParser<MessageBroadcastResponse> Parser { get { return _parser; } }
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public static pbr::MessageDescriptor Descriptor {
|
||||
get { return global::MessageBroadcastReflection.Descriptor.MessageTypes[1]; }
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
pbr::MessageDescriptor pb::IMessage.Descriptor {
|
||||
get { return Descriptor; }
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public MessageBroadcastResponse() {
|
||||
OnConstruction();
|
||||
}
|
||||
|
||||
partial void OnConstruction();
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public MessageBroadcastResponse(MessageBroadcastResponse other) : this() {
|
||||
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public MessageBroadcastResponse Clone() {
|
||||
return new MessageBroadcastResponse(this);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public override bool Equals(object other) {
|
||||
return Equals(other as MessageBroadcastResponse);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public bool Equals(MessageBroadcastResponse other) {
|
||||
if (ReferenceEquals(other, null)) {
|
||||
return false;
|
||||
}
|
||||
if (ReferenceEquals(other, this)) {
|
||||
return true;
|
||||
}
|
||||
return Equals(_unknownFields, other._unknownFields);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public override int GetHashCode() {
|
||||
int hash = 1;
|
||||
if (_unknownFields != null) {
|
||||
hash ^= _unknownFields.GetHashCode();
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public override string ToString() {
|
||||
return pb::JsonFormatter.ToDiagnosticString(this);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public void WriteTo(pb::CodedOutputStream output) {
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
output.WriteRawMessage(this);
|
||||
#else
|
||||
if (_unknownFields != null) {
|
||||
_unknownFields.WriteTo(output);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
|
||||
if (_unknownFields != null) {
|
||||
_unknownFields.WriteTo(ref output);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public int CalculateSize() {
|
||||
int size = 0;
|
||||
if (_unknownFields != null) {
|
||||
size += _unknownFields.CalculateSize();
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public void MergeFrom(MessageBroadcastResponse other) {
|
||||
if (other == null) {
|
||||
return;
|
||||
}
|
||||
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public void MergeFrom(pb::CodedInputStream input) {
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
input.ReadRawMessage(this);
|
||||
#else
|
||||
uint tag;
|
||||
while ((tag = input.ReadTag()) != 0) {
|
||||
if ((tag & 7) == 4) {
|
||||
// Abort on any end group tag.
|
||||
return;
|
||||
}
|
||||
switch(tag) {
|
||||
default:
|
||||
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
|
||||
uint tag;
|
||||
while ((tag = input.ReadTag()) != 0) {
|
||||
if ((tag & 7) == 4) {
|
||||
// Abort on any end group tag.
|
||||
return;
|
||||
}
|
||||
switch(tag) {
|
||||
default:
|
||||
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#endregion Designer generated code
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 061900a49550cc74582eb8e4598a886b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3b549e9113344b542a6f785f98166927
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7a2dfd72791480141a3dca377b5196d1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 66a0cd6fc174b4042b409c9030c08516
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,28 +0,0 @@
|
||||
using Google.Protobuf;
|
||||
using System;
|
||||
public class ProtoBufffer
|
||||
{
|
||||
public static byte[] Serialize(IMessage message)
|
||||
{
|
||||
return message.ToByteArray();
|
||||
}
|
||||
|
||||
public static T DeSerialize<T>(byte[] packet) where T : IMessage, new()
|
||||
{
|
||||
IMessage message = new T();
|
||||
try
|
||||
{
|
||||
return (T)message.Descriptor.Parser.ParseFrom(packet);
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
internal static T DeSerialize<T>(ByteString data)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cbf21bdbee5a320489df7092ce24d9a7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: efe7f33d728ac2948956f9a0bcf43259
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7dc2c5b09fa1821438dbc817a6f5cb74
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 89dab302d915deb4ba459f561a2a9f15
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,726 +0,0 @@
|
||||
// <auto-generated>
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: ws.proto
|
||||
// </auto-generated>
|
||||
#pragma warning disable 1591, 0612, 3021, 8981
|
||||
#region Designer generated code
|
||||
|
||||
using pb = global::Google.Protobuf;
|
||||
using pbc = global::Google.Protobuf.Collections;
|
||||
using pbr = global::Google.Protobuf.Reflection;
|
||||
using scg = global::System.Collections.Generic;
|
||||
/// <summary>Holder for reflection information generated from ws.proto</summary>
|
||||
public static partial class WsReflection {
|
||||
|
||||
#region Descriptor
|
||||
/// <summary>File descriptor for ws.proto</summary>
|
||||
public static pbr::FileDescriptor Descriptor {
|
||||
get { return descriptor; }
|
||||
}
|
||||
private static pbr::FileDescriptor descriptor;
|
||||
|
||||
static WsReflection() {
|
||||
byte[] descriptorData = global::System.Convert.FromBase64String(
|
||||
string.Concat(
|
||||
"Cgh3cy5wcm90byJNCglXU01lc3NhZ2USDgoGbW9kdWxlGAEgASgJEhMKC3Nl",
|
||||
"cnZpY2VOYW1lGAIgASgJEgwKBGRhdGEYAyABKAwSDQoFcmVxSWQYBCABKAUi",
|
||||
"WQoKV1NSZXNwb25zZRITCgttZXNzYWdlVHlwZRgBIAEoCRIMCgRkYXRhGAIg",
|
||||
"ASgMEg0KBXJlcUlkGAMgASgFEgwKBGNvZGUYBCABKAUSCwoDemlwGAUgASgI",
|
||||
"QgdaBS4vO3BiYgZwcm90bzM="));
|
||||
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
|
||||
new pbr::FileDescriptor[] { },
|
||||
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
|
||||
new pbr::GeneratedClrTypeInfo(typeof(global::WSMessage), global::WSMessage.Parser, new[]{ "Module", "ServiceName", "Data", "ReqId" }, null, null, null, null),
|
||||
new pbr::GeneratedClrTypeInfo(typeof(global::WSResponse), global::WSResponse.Parser, new[]{ "MessageType", "Data", "ReqId", "Code", "Zip" }, null, null, null, null)
|
||||
}));
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
#region Messages
|
||||
[global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
|
||||
public sealed partial class WSMessage : pb::IMessage<WSMessage>
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
, pb::IBufferMessage
|
||||
#endif
|
||||
{
|
||||
private static readonly pb::MessageParser<WSMessage> _parser = new pb::MessageParser<WSMessage>(() => new WSMessage());
|
||||
private pb::UnknownFieldSet _unknownFields;
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public static pb::MessageParser<WSMessage> Parser { get { return _parser; } }
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public static pbr::MessageDescriptor Descriptor {
|
||||
get { return global::WsReflection.Descriptor.MessageTypes[0]; }
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
pbr::MessageDescriptor pb::IMessage.Descriptor {
|
||||
get { return Descriptor; }
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public WSMessage() {
|
||||
OnConstruction();
|
||||
}
|
||||
|
||||
partial void OnConstruction();
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public WSMessage(WSMessage other) : this() {
|
||||
module_ = other.module_;
|
||||
serviceName_ = other.serviceName_;
|
||||
data_ = other.data_;
|
||||
reqId_ = other.reqId_;
|
||||
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public WSMessage Clone() {
|
||||
return new WSMessage(this);
|
||||
}
|
||||
|
||||
/// <summary>Field number for the "module" field.</summary>
|
||||
public const int ModuleFieldNumber = 1;
|
||||
private string module_ = "";
|
||||
/// <summary>
|
||||
///模块名称
|
||||
/// </summary>
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public string Module {
|
||||
get { return module_; }
|
||||
set {
|
||||
module_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Field number for the "serviceName" field.</summary>
|
||||
public const int ServiceNameFieldNumber = 2;
|
||||
private string serviceName_ = "";
|
||||
/// <summary>
|
||||
///服务名称
|
||||
/// </summary>
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public string ServiceName {
|
||||
get { return serviceName_; }
|
||||
set {
|
||||
serviceName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Field number for the "data" field.</summary>
|
||||
public const int DataFieldNumber = 3;
|
||||
private pb::ByteString data_ = pb::ByteString.Empty;
|
||||
/// <summary>
|
||||
///请求数据
|
||||
/// </summary>
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public pb::ByteString Data {
|
||||
get { return data_; }
|
||||
set {
|
||||
data_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Field number for the "reqId" field.</summary>
|
||||
public const int ReqIdFieldNumber = 4;
|
||||
private int reqId_;
|
||||
/// <summary>
|
||||
///请求id
|
||||
/// </summary>
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public int ReqId {
|
||||
get { return reqId_; }
|
||||
set {
|
||||
reqId_ = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public override bool Equals(object other) {
|
||||
return Equals(other as WSMessage);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public bool Equals(WSMessage other) {
|
||||
if (ReferenceEquals(other, null)) {
|
||||
return false;
|
||||
}
|
||||
if (ReferenceEquals(other, this)) {
|
||||
return true;
|
||||
}
|
||||
if (Module != other.Module) return false;
|
||||
if (ServiceName != other.ServiceName) return false;
|
||||
if (Data != other.Data) return false;
|
||||
if (ReqId != other.ReqId) return false;
|
||||
return Equals(_unknownFields, other._unknownFields);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public override int GetHashCode() {
|
||||
int hash = 1;
|
||||
if (Module.Length != 0) hash ^= Module.GetHashCode();
|
||||
if (ServiceName.Length != 0) hash ^= ServiceName.GetHashCode();
|
||||
if (Data.Length != 0) hash ^= Data.GetHashCode();
|
||||
if (ReqId != 0) hash ^= ReqId.GetHashCode();
|
||||
if (_unknownFields != null) {
|
||||
hash ^= _unknownFields.GetHashCode();
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public override string ToString() {
|
||||
return pb::JsonFormatter.ToDiagnosticString(this);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public void WriteTo(pb::CodedOutputStream output) {
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
output.WriteRawMessage(this);
|
||||
#else
|
||||
if (Module.Length != 0) {
|
||||
output.WriteRawTag(10);
|
||||
output.WriteString(Module);
|
||||
}
|
||||
if (ServiceName.Length != 0) {
|
||||
output.WriteRawTag(18);
|
||||
output.WriteString(ServiceName);
|
||||
}
|
||||
if (Data.Length != 0) {
|
||||
output.WriteRawTag(26);
|
||||
output.WriteBytes(Data);
|
||||
}
|
||||
if (ReqId != 0) {
|
||||
output.WriteRawTag(32);
|
||||
output.WriteInt32(ReqId);
|
||||
}
|
||||
if (_unknownFields != null) {
|
||||
_unknownFields.WriteTo(output);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
|
||||
if (Module.Length != 0) {
|
||||
output.WriteRawTag(10);
|
||||
output.WriteString(Module);
|
||||
}
|
||||
if (ServiceName.Length != 0) {
|
||||
output.WriteRawTag(18);
|
||||
output.WriteString(ServiceName);
|
||||
}
|
||||
if (Data.Length != 0) {
|
||||
output.WriteRawTag(26);
|
||||
output.WriteBytes(Data);
|
||||
}
|
||||
if (ReqId != 0) {
|
||||
output.WriteRawTag(32);
|
||||
output.WriteInt32(ReqId);
|
||||
}
|
||||
if (_unknownFields != null) {
|
||||
_unknownFields.WriteTo(ref output);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public int CalculateSize() {
|
||||
int size = 0;
|
||||
if (Module.Length != 0) {
|
||||
size += 1 + pb::CodedOutputStream.ComputeStringSize(Module);
|
||||
}
|
||||
if (ServiceName.Length != 0) {
|
||||
size += 1 + pb::CodedOutputStream.ComputeStringSize(ServiceName);
|
||||
}
|
||||
if (Data.Length != 0) {
|
||||
size += 1 + pb::CodedOutputStream.ComputeBytesSize(Data);
|
||||
}
|
||||
if (ReqId != 0) {
|
||||
size += 1 + pb::CodedOutputStream.ComputeInt32Size(ReqId);
|
||||
}
|
||||
if (_unknownFields != null) {
|
||||
size += _unknownFields.CalculateSize();
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public void MergeFrom(WSMessage other) {
|
||||
if (other == null) {
|
||||
return;
|
||||
}
|
||||
if (other.Module.Length != 0) {
|
||||
Module = other.Module;
|
||||
}
|
||||
if (other.ServiceName.Length != 0) {
|
||||
ServiceName = other.ServiceName;
|
||||
}
|
||||
if (other.Data.Length != 0) {
|
||||
Data = other.Data;
|
||||
}
|
||||
if (other.ReqId != 0) {
|
||||
ReqId = other.ReqId;
|
||||
}
|
||||
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public void MergeFrom(pb::CodedInputStream input) {
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
input.ReadRawMessage(this);
|
||||
#else
|
||||
uint tag;
|
||||
while ((tag = input.ReadTag()) != 0) {
|
||||
if ((tag & 7) == 4) {
|
||||
// Abort on any end group tag.
|
||||
return;
|
||||
}
|
||||
switch(tag) {
|
||||
default:
|
||||
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
|
||||
break;
|
||||
case 10: {
|
||||
Module = input.ReadString();
|
||||
break;
|
||||
}
|
||||
case 18: {
|
||||
ServiceName = input.ReadString();
|
||||
break;
|
||||
}
|
||||
case 26: {
|
||||
Data = input.ReadBytes();
|
||||
break;
|
||||
}
|
||||
case 32: {
|
||||
ReqId = input.ReadInt32();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
|
||||
uint tag;
|
||||
while ((tag = input.ReadTag()) != 0) {
|
||||
if ((tag & 7) == 4) {
|
||||
// Abort on any end group tag.
|
||||
return;
|
||||
}
|
||||
switch(tag) {
|
||||
default:
|
||||
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
|
||||
break;
|
||||
case 10: {
|
||||
Module = input.ReadString();
|
||||
break;
|
||||
}
|
||||
case 18: {
|
||||
ServiceName = input.ReadString();
|
||||
break;
|
||||
}
|
||||
case 26: {
|
||||
Data = input.ReadBytes();
|
||||
break;
|
||||
}
|
||||
case 32: {
|
||||
ReqId = input.ReadInt32();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
|
||||
public sealed partial class WSResponse : pb::IMessage<WSResponse>
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
, pb::IBufferMessage
|
||||
#endif
|
||||
{
|
||||
private static readonly pb::MessageParser<WSResponse> _parser = new pb::MessageParser<WSResponse>(() => new WSResponse());
|
||||
private pb::UnknownFieldSet _unknownFields;
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public static pb::MessageParser<WSResponse> Parser { get { return _parser; } }
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public static pbr::MessageDescriptor Descriptor {
|
||||
get { return global::WsReflection.Descriptor.MessageTypes[1]; }
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
pbr::MessageDescriptor pb::IMessage.Descriptor {
|
||||
get { return Descriptor; }
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public WSResponse() {
|
||||
OnConstruction();
|
||||
}
|
||||
|
||||
partial void OnConstruction();
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public WSResponse(WSResponse other) : this() {
|
||||
messageType_ = other.messageType_;
|
||||
data_ = other.data_;
|
||||
reqId_ = other.reqId_;
|
||||
code_ = other.code_;
|
||||
zip_ = other.zip_;
|
||||
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public WSResponse Clone() {
|
||||
return new WSResponse(this);
|
||||
}
|
||||
|
||||
/// <summary>Field number for the "messageType" field.</summary>
|
||||
public const int MessageTypeFieldNumber = 1;
|
||||
private string messageType_ = "";
|
||||
/// <summary>
|
||||
///响应消息
|
||||
/// </summary>
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public string MessageType {
|
||||
get { return messageType_; }
|
||||
set {
|
||||
messageType_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Field number for the "data" field.</summary>
|
||||
public const int DataFieldNumber = 2;
|
||||
private pb::ByteString data_ = pb::ByteString.Empty;
|
||||
/// <summary>
|
||||
///响应数据
|
||||
/// </summary>
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public pb::ByteString Data {
|
||||
get { return data_; }
|
||||
set {
|
||||
data_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Field number for the "reqId" field.</summary>
|
||||
public const int ReqIdFieldNumber = 3;
|
||||
private int reqId_;
|
||||
/// <summary>
|
||||
///请求id
|
||||
/// </summary>
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public int ReqId {
|
||||
get { return reqId_; }
|
||||
set {
|
||||
reqId_ = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Field number for the "code" field.</summary>
|
||||
public const int CodeFieldNumber = 4;
|
||||
private int code_;
|
||||
/// <summary>
|
||||
///响应状态码
|
||||
/// </summary>
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public int Code {
|
||||
get { return code_; }
|
||||
set {
|
||||
code_ = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Field number for the "zip" field.</summary>
|
||||
public const int ZipFieldNumber = 5;
|
||||
private bool zip_;
|
||||
/// <summary>
|
||||
///是否压缩
|
||||
/// </summary>
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public bool Zip {
|
||||
get { return zip_; }
|
||||
set {
|
||||
zip_ = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public override bool Equals(object other) {
|
||||
return Equals(other as WSResponse);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public bool Equals(WSResponse other) {
|
||||
if (ReferenceEquals(other, null)) {
|
||||
return false;
|
||||
}
|
||||
if (ReferenceEquals(other, this)) {
|
||||
return true;
|
||||
}
|
||||
if (MessageType != other.MessageType) return false;
|
||||
if (Data != other.Data) return false;
|
||||
if (ReqId != other.ReqId) return false;
|
||||
if (Code != other.Code) return false;
|
||||
if (Zip != other.Zip) return false;
|
||||
return Equals(_unknownFields, other._unknownFields);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public override int GetHashCode() {
|
||||
int hash = 1;
|
||||
if (MessageType.Length != 0) hash ^= MessageType.GetHashCode();
|
||||
if (Data.Length != 0) hash ^= Data.GetHashCode();
|
||||
if (ReqId != 0) hash ^= ReqId.GetHashCode();
|
||||
if (Code != 0) hash ^= Code.GetHashCode();
|
||||
if (Zip != false) hash ^= Zip.GetHashCode();
|
||||
if (_unknownFields != null) {
|
||||
hash ^= _unknownFields.GetHashCode();
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public override string ToString() {
|
||||
return pb::JsonFormatter.ToDiagnosticString(this);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public void WriteTo(pb::CodedOutputStream output) {
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
output.WriteRawMessage(this);
|
||||
#else
|
||||
if (MessageType.Length != 0) {
|
||||
output.WriteRawTag(10);
|
||||
output.WriteString(MessageType);
|
||||
}
|
||||
if (Data.Length != 0) {
|
||||
output.WriteRawTag(18);
|
||||
output.WriteBytes(Data);
|
||||
}
|
||||
if (ReqId != 0) {
|
||||
output.WriteRawTag(24);
|
||||
output.WriteInt32(ReqId);
|
||||
}
|
||||
if (Code != 0) {
|
||||
output.WriteRawTag(32);
|
||||
output.WriteInt32(Code);
|
||||
}
|
||||
if (Zip != false) {
|
||||
output.WriteRawTag(40);
|
||||
output.WriteBool(Zip);
|
||||
}
|
||||
if (_unknownFields != null) {
|
||||
_unknownFields.WriteTo(output);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
|
||||
if (MessageType.Length != 0) {
|
||||
output.WriteRawTag(10);
|
||||
output.WriteString(MessageType);
|
||||
}
|
||||
if (Data.Length != 0) {
|
||||
output.WriteRawTag(18);
|
||||
output.WriteBytes(Data);
|
||||
}
|
||||
if (ReqId != 0) {
|
||||
output.WriteRawTag(24);
|
||||
output.WriteInt32(ReqId);
|
||||
}
|
||||
if (Code != 0) {
|
||||
output.WriteRawTag(32);
|
||||
output.WriteInt32(Code);
|
||||
}
|
||||
if (Zip != false) {
|
||||
output.WriteRawTag(40);
|
||||
output.WriteBool(Zip);
|
||||
}
|
||||
if (_unknownFields != null) {
|
||||
_unknownFields.WriteTo(ref output);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public int CalculateSize() {
|
||||
int size = 0;
|
||||
if (MessageType.Length != 0) {
|
||||
size += 1 + pb::CodedOutputStream.ComputeStringSize(MessageType);
|
||||
}
|
||||
if (Data.Length != 0) {
|
||||
size += 1 + pb::CodedOutputStream.ComputeBytesSize(Data);
|
||||
}
|
||||
if (ReqId != 0) {
|
||||
size += 1 + pb::CodedOutputStream.ComputeInt32Size(ReqId);
|
||||
}
|
||||
if (Code != 0) {
|
||||
size += 1 + pb::CodedOutputStream.ComputeInt32Size(Code);
|
||||
}
|
||||
if (Zip != false) {
|
||||
size += 1 + 1;
|
||||
}
|
||||
if (_unknownFields != null) {
|
||||
size += _unknownFields.CalculateSize();
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public void MergeFrom(WSResponse other) {
|
||||
if (other == null) {
|
||||
return;
|
||||
}
|
||||
if (other.MessageType.Length != 0) {
|
||||
MessageType = other.MessageType;
|
||||
}
|
||||
if (other.Data.Length != 0) {
|
||||
Data = other.Data;
|
||||
}
|
||||
if (other.ReqId != 0) {
|
||||
ReqId = other.ReqId;
|
||||
}
|
||||
if (other.Code != 0) {
|
||||
Code = other.Code;
|
||||
}
|
||||
if (other.Zip != false) {
|
||||
Zip = other.Zip;
|
||||
}
|
||||
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
public void MergeFrom(pb::CodedInputStream input) {
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
input.ReadRawMessage(this);
|
||||
#else
|
||||
uint tag;
|
||||
while ((tag = input.ReadTag()) != 0) {
|
||||
if ((tag & 7) == 4) {
|
||||
// Abort on any end group tag.
|
||||
return;
|
||||
}
|
||||
switch(tag) {
|
||||
default:
|
||||
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
|
||||
break;
|
||||
case 10: {
|
||||
MessageType = input.ReadString();
|
||||
break;
|
||||
}
|
||||
case 18: {
|
||||
Data = input.ReadBytes();
|
||||
break;
|
||||
}
|
||||
case 24: {
|
||||
ReqId = input.ReadInt32();
|
||||
break;
|
||||
}
|
||||
case 32: {
|
||||
Code = input.ReadInt32();
|
||||
break;
|
||||
}
|
||||
case 40: {
|
||||
Zip = input.ReadBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
|
||||
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
|
||||
uint tag;
|
||||
while ((tag = input.ReadTag()) != 0) {
|
||||
if ((tag & 7) == 4) {
|
||||
// Abort on any end group tag.
|
||||
return;
|
||||
}
|
||||
switch(tag) {
|
||||
default:
|
||||
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
|
||||
break;
|
||||
case 10: {
|
||||
MessageType = input.ReadString();
|
||||
break;
|
||||
}
|
||||
case 18: {
|
||||
Data = input.ReadBytes();
|
||||
break;
|
||||
}
|
||||
case 24: {
|
||||
ReqId = input.ReadInt32();
|
||||
break;
|
||||
}
|
||||
case 32: {
|
||||
Code = input.ReadInt32();
|
||||
break;
|
||||
}
|
||||
case 40: {
|
||||
Zip = input.ReadBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#endregion Designer generated code
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6d54b057f10017a4d98893bdbd8509e0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a7ecaeb120769bd4c98162eaf5a5c215
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,34 +0,0 @@
|
||||
using DG.Tweening;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class EventPopUp : MonoBehaviour
|
||||
{
|
||||
public string text = "";
|
||||
public Image Image;
|
||||
public Text textobg;
|
||||
public float time = 5f;
|
||||
async void Start()
|
||||
{
|
||||
Canvas canvas = GetComponentInParent<Canvas>();
|
||||
float canvasHeight = canvas.GetComponent<RectTransform>().rect.height;
|
||||
transform.DOMoveY(canvasHeight - (canvasHeight*0.3f), 1.5f);
|
||||
await Task.Delay(500);
|
||||
Image.DOColor(new Color(1f, 1f, 1f, 0f), time);
|
||||
textobg.DOColor(new Color(1f, 1f, 1f, 0f), time);
|
||||
await Task.Delay(5100);
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (textobg != null)
|
||||
{
|
||||
textobg.text = text;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 58e836951d7e1724db6a078984a9b193
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,62 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
using System.Threading.Tasks;
|
||||
using System;
|
||||
|
||||
|
||||
public class ImageLoader : MonoBehaviour
|
||||
{
|
||||
// 缓存字典
|
||||
private Dictionary<string, Sprite> imageCache = new Dictionary<string, Sprite>();
|
||||
public Sprite sprite;
|
||||
// 异步加载图片
|
||||
public async Task<Sprite> LoadImageAsync(string url)
|
||||
{
|
||||
if (!IsValidUrl(url))
|
||||
{
|
||||
return sprite;
|
||||
}
|
||||
// 如果缓存中已经有图片,则直接返回缓存的图片
|
||||
if (imageCache.ContainsKey(url))
|
||||
{
|
||||
return imageCache[url];
|
||||
}
|
||||
|
||||
// 如果缓存中没有图片,则异步加载
|
||||
using (UnityWebRequest webRequest = UnityWebRequestTexture.GetTexture(url))
|
||||
{
|
||||
// 发送请求并等待响应
|
||||
var operation = webRequest.SendWebRequest();
|
||||
while (!operation.isDone)
|
||||
await Task.Yield(); // 等待请求完成,使用await以非阻塞的方式处理
|
||||
// 检查请求是否成功
|
||||
if (webRequest.result == UnityWebRequest.Result.Success)
|
||||
{
|
||||
// 获取下载的纹理
|
||||
Texture2D texture = ((DownloadHandlerTexture)webRequest.downloadHandler).texture;
|
||||
|
||||
// 将纹理缓存
|
||||
imageCache[url] = TextureToSprite(texture);
|
||||
return imageCache[url];
|
||||
}
|
||||
else
|
||||
{
|
||||
//Debug.LogError("Failed to load image: " + webRequest.error);
|
||||
return sprite;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 将Texture2D转换为Sprite
|
||||
Sprite TextureToSprite(Texture2D texture)
|
||||
{
|
||||
// 使用纹理的尺寸创建一个Sprite
|
||||
return Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f));
|
||||
}
|
||||
|
||||
public static bool IsValidUrl(string url)
|
||||
{
|
||||
Uri uriResult;
|
||||
return Uri.TryCreate(url, UriKind.Absolute, out uriResult) && (uriResult.Scheme == Uri.UriSchemeHttp || uriResult.Scheme == Uri.UriSchemeHttps);
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1a6867b83e3950542877ec6fb010c5d8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences:
|
||||
- sprite: {fileID: 21300000, guid: a9888f3a212da7c49aefef81a2194eca, type: 3}
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,162 +0,0 @@
|
||||
using DG.Tweening;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
|
||||
|
||||
public class Base : MonoBehaviour
|
||||
{
|
||||
private List<string> LoadClassName = new List<string>() { "ImageLoader" , "Global" };//写入需要全局自动实例化的类
|
||||
public Button retbutton;
|
||||
public GameObject ClosureObj;
|
||||
public static GameObject GlobalObj;
|
||||
private void Awake()
|
||||
{
|
||||
|
||||
Application.targetFrameRate = Mathf.RoundToInt(55f); // 设置目标帧率
|
||||
initializeGlobal();
|
||||
if (retbutton != null)
|
||||
{
|
||||
retbutton.onClick.AddListener(() => CancelOnClick(retbutton, ClosureObj));
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 初始化全局节点管理器
|
||||
/// </summary>
|
||||
private void initializeGlobal()
|
||||
{
|
||||
if (GlobalObj == null)
|
||||
{
|
||||
GlobalObj = new GameObject("GlobalObj");
|
||||
DontDestroyOnLoad(GlobalObj);
|
||||
foreach (string className in LoadClassName) {
|
||||
CallClassByString(className);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 用于通过类名字符串动态调用类和方法
|
||||
/// </summary>
|
||||
public void CallClassByString(string className)
|
||||
{
|
||||
// 获取类的 Type 对象
|
||||
Type type = Type.GetType(className);
|
||||
|
||||
if (type != null)
|
||||
{
|
||||
GlobalObj.AddComponent(type);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Class not found.");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 播放按钮动画
|
||||
/// </summary>
|
||||
public async Task ButtonClickAnimationAsync(GameObject button,float max=1.25f,float timemultiple = 1)
|
||||
{
|
||||
TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>();
|
||||
Sequence mySequence = DOTween.Sequence();
|
||||
mySequence.Append(button.transform.DOScale(max, 0.1f* timemultiple)) // 第一个动画
|
||||
.Append(button.transform.DOScale(1f, 0.2f* timemultiple)).OnComplete(() => {
|
||||
// 动画播放完成后执行的代码
|
||||
tcs.SetResult(true);
|
||||
}); // 第二个动画
|
||||
await tcs.Task;
|
||||
}
|
||||
/// <summary>
|
||||
/// 添加上移通用弹窗
|
||||
/// </summary>
|
||||
public void addEventPopUp(string Details,float time = 5f)
|
||||
{
|
||||
GameObject prefab = Resources.Load<GameObject>("base/EventPopUp");
|
||||
prefab.GetComponent<EventPopUp>().time = time;
|
||||
Canvas canvas = GetComponentInParent<Canvas>();
|
||||
prefab.GetComponent<EventPopUp>().text = Details;
|
||||
Instantiate(prefab, canvas.transform);
|
||||
}
|
||||
|
||||
//logoPanel.ServerResponse TestserverResponse;
|
||||
//protected Dictionary<string, string> testhead;
|
||||
///// <summary>
|
||||
///// 测试登录
|
||||
///// </summary>
|
||||
//public async void testLogo()
|
||||
//{
|
||||
|
||||
// LoginAndGetToken.loginbody body = new LoginAndGetToken.loginbody
|
||||
// {
|
||||
// userName = "15151658596",
|
||||
// password = "123456",
|
||||
// verifyCode = 111111
|
||||
// };
|
||||
// string loginResponse = await web.SendRequest(web.URL + "/snail/user/login", "POST", JsonUtility.ToJson(body));
|
||||
// logoPanel.ServerResponse response = JsonUtility.FromJson<logoPanel.ServerResponse>(loginResponse);
|
||||
// if (response != null && response.code == 200 && response.data != null)
|
||||
// {
|
||||
// TestserverResponse = response;
|
||||
// addEventPopUp("测试登录成功");
|
||||
|
||||
// testhead = new Dictionary<string, string>
|
||||
// {
|
||||
// { "Authorization", TestserverResponse.data.token }
|
||||
// };
|
||||
// return;
|
||||
// }
|
||||
// addEventPopUp(response.message);
|
||||
// testhead = new Dictionary<string, string>();
|
||||
//}
|
||||
/// <summary>
|
||||
/// 判断必须为小数而且大于0
|
||||
/// </summary>
|
||||
public bool IsGreaterThanZeroDecimal(string text)
|
||||
{
|
||||
// 使用正则表达式匹配大于0的小数
|
||||
string pattern = @"^(?!0(\.0+)?$)(\d+(\.\d+)?|\.\d+)$";
|
||||
Regex regex = new Regex(pattern);
|
||||
|
||||
return regex.IsMatch(text);
|
||||
}
|
||||
/// <summary>
|
||||
/// 取消按钮
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
/// <param name="my_gameObject"></param>
|
||||
public async void CancelOnClick(Button button,GameObject my_gameObject = null)
|
||||
{
|
||||
await ButtonClickAnimationAsync(button.gameObject);
|
||||
if (gameObject != null)
|
||||
{
|
||||
if (my_gameObject != null)
|
||||
{
|
||||
Destroy(my_gameObject);
|
||||
return;
|
||||
}
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 给按钮绑定点击动画
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
public void AddingAButtonEvent(Button button)
|
||||
{
|
||||
if (button != null)
|
||||
{
|
||||
button.onClick.AddListener(() => ButtonClickAnimationAsync(button.gameObject));
|
||||
}
|
||||
else {
|
||||
Debug.Log("未找到按钮");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 00712f61a0d6af941877575b41fae4cb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e65d23b77802d8944994c1057329e190
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
Before Width: | Height: | Size: 120 KiB |
@ -1,123 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 687da5e613e0f564abe65073acbd99a8
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMasterTextureLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 512
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
Before Width: | Height: | Size: 463 KiB |
@ -1,123 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a9888f3a212da7c49aefef81a2194eca
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMasterTextureLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 93c3109c54e51d24a8bf32cadb614682
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,68 +0,0 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using UnityEngine;
|
||||
using Debug = UnityEngine.Debug;
|
||||
|
||||
public class RichText : MonoBehaviour
|
||||
{
|
||||
[Header("文本预制体")] public GameObject textItem;
|
||||
private string text = "";
|
||||
|
||||
public string Text
|
||||
{
|
||||
[DebuggerStepThrough] get => text;
|
||||
[DebuggerStepThrough]
|
||||
set
|
||||
{
|
||||
text = value;
|
||||
Debug.Log("===------");
|
||||
Debug.Log("<p>" + text + "</p>");
|
||||
foreach (string item in SplitStringByTags("<p>" + text + "</p>", 23))
|
||||
{
|
||||
|
||||
GameObject gameObject = Instantiate(textItem, GameObject.Find(name).transform);
|
||||
gameObject.GetComponent<TextItem>().updateText(item);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static string[] SplitStringByTags(string input, int maxLength)
|
||||
{
|
||||
// 使用正则表达式匹配 <p> 标签以及其中的内容
|
||||
var regex = new System.Text.RegularExpressions.Regex(@"<p>(.*?)</p>");
|
||||
var matches = regex.Matches(input);
|
||||
|
||||
// 用于存储结果
|
||||
var resultList = new System.Collections.Generic.List<string>();
|
||||
|
||||
foreach (System.Text.RegularExpressions.Match match in matches)
|
||||
{
|
||||
string line = match.Groups[1].Value; // 获取<p>和</p>之间的内容
|
||||
|
||||
if (line.Length > maxLength)
|
||||
{
|
||||
// 如果行的长度大于maxLength,则拆分成多个子字符串
|
||||
for (int i = 0; i < line.Length; i += maxLength)
|
||||
{
|
||||
int length = Math.Min(maxLength, line.Length - i);
|
||||
resultList.Add(line.Substring(i, length));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
resultList.Add(line);
|
||||
}
|
||||
}
|
||||
|
||||
return resultList.ToArray();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e8f7862dad4a20e41b1cba0caced8a02
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,17 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class TextItem : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
string text = "";
|
||||
public Text textObj;
|
||||
|
||||
public void updateText(string text)
|
||||
{
|
||||
textObj.text = text;
|
||||
this.text = text;
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5090ecb3a8ac1844e97d10585aeee7f8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,116 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &9045295390659229329
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 9045295390659229328}
|
||||
- component: {fileID: 9045295390659229335}
|
||||
- component: {fileID: 9045295390659229334}
|
||||
- component: {fileID: 9045295390659229332}
|
||||
- component: {fileID: 9045295390659229333}
|
||||
m_Layer: 5
|
||||
m_Name: richText
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &9045295390659229328
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9045295390659229329}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 472.68884, y: -409}
|
||||
m_SizeDelta: {x: 945.3777, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &9045295390659229335
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9045295390659229329}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Padding:
|
||||
m_Left: 61
|
||||
m_Right: 50
|
||||
m_Top: 38
|
||||
m_Bottom: 15
|
||||
m_ChildAlignment: 0
|
||||
m_Spacing: 0
|
||||
m_ChildForceExpandWidth: 1
|
||||
m_ChildForceExpandHeight: 1
|
||||
m_ChildControlWidth: 1
|
||||
m_ChildControlHeight: 0
|
||||
m_ChildScaleWidth: 0
|
||||
m_ChildScaleHeight: 0
|
||||
m_ReverseArrangement: 0
|
||||
--- !u!114 &9045295390659229334
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9045295390659229329}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e8f7862dad4a20e41b1cba0caced8a02, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
textItem: {fileID: 558835775278395819, guid: 6efb80a40cba2eb419a3e3b04ef41d95, type: 3}
|
||||
textTransform: {fileID: 9045295390659229328}
|
||||
--- !u!114 &9045295390659229332
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9045295390659229329}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_HorizontalFit: 0
|
||||
m_VerticalFit: 2
|
||||
--- !u!114 &9045295390659229333
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9045295390659229329}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreLayout: 0
|
||||
m_MinWidth: -1
|
||||
m_MinHeight: 818
|
||||
m_PreferredWidth: -1
|
||||
m_PreferredHeight: -1
|
||||
m_FlexibleWidth: -1
|
||||
m_FlexibleHeight: -1
|
||||
m_LayoutPriority: 1
|
@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 34e251aed5d6a704d8b5e557ebd3f2ce
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,282 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &558835774724421752
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 558835774724421753}
|
||||
- component: {fileID: 558835774724421732}
|
||||
- component: {fileID: 558835774724421735}
|
||||
- component: {fileID: 558835774724421734}
|
||||
m_Layer: 5
|
||||
m_Name: Text (Legacy)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &558835774724421753
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 558835774724421752}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 558835775278395816}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 417.18884, y: -41}
|
||||
m_SizeDelta: {x: 834.3777, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &558835774724421732
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 558835774724421752}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &558835774724421735
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 558835774724421752}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.43529412, g: 0.4, b: 0.39215687, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 36
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 3
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 0
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: "\u5F00\u670D\u671F\u95F4\u9080\u8BF7\u597D\u53CB\u53EF\u8D60\u9001\u798F\u5229\uFF01\n"
|
||||
--- !u!114 &558835774724421734
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 558835774724421752}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_HorizontalFit: 0
|
||||
m_VerticalFit: 2
|
||||
--- !u!1 &558835775278395819
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 558835775278395816}
|
||||
- component: {fileID: 558835775278395798}
|
||||
- component: {fileID: 558835775278395817}
|
||||
- component: {fileID: 5233847271531102684}
|
||||
m_Layer: 5
|
||||
m_Name: textItem
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &558835775278395816
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 558835775278395819}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 558835774724421753}
|
||||
- {fileID: 558835775750597766}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 478.18884, y: -73.6582}
|
||||
m_SizeDelta: {x: 834.3777, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &558835775278395798
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 558835775278395819}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_HorizontalFit: 0
|
||||
m_VerticalFit: 2
|
||||
--- !u!114 &558835775278395817
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 558835775278395819}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Padding:
|
||||
m_Left: 0
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_ChildAlignment: 0
|
||||
m_Spacing: 12
|
||||
m_ChildForceExpandWidth: 1
|
||||
m_ChildForceExpandHeight: 1
|
||||
m_ChildControlWidth: 1
|
||||
m_ChildControlHeight: 1
|
||||
m_ChildScaleWidth: 0
|
||||
m_ChildScaleHeight: 0
|
||||
m_ReverseArrangement: 0
|
||||
--- !u!114 &5233847271531102684
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 558835775278395819}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5090ecb3a8ac1844e97d10585aeee7f8, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
textObj: {fileID: 558835774724421735}
|
||||
--- !u!1 &558835775750597785
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 558835775750597766}
|
||||
- component: {fileID: 558835775750597764}
|
||||
- component: {fileID: 558835775750597767}
|
||||
- component: {fileID: 4730459335855531252}
|
||||
m_Layer: 5
|
||||
m_Name: Image
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &558835775750597766
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 558835775750597785}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 558835775278395816}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 417.18884, y: -95.5}
|
||||
m_SizeDelta: {x: 834.3777, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &558835775750597764
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 558835775750597785}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &558835775750597767
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 558835775750597785}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: dafe24c3322b8674e83db659604ec4b1, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &4730459335855531252
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 558835775750597785}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_HorizontalFit: 0
|
||||
m_VerticalFit: 2
|
@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6efb80a40cba2eb419a3e3b04ef41d95
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,109 +1,109 @@
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Unity.VisualScripting.Antlr3.Runtime;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
//using System.Collections;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Text;
|
||||
//using System.Threading.Tasks;
|
||||
//using Unity.VisualScripting.Antlr3.Runtime;
|
||||
//using UnityEngine;
|
||||
//using UnityEngine.Networking;
|
||||
|
||||
|
||||
|
||||
|
||||
public class web : MonoBehaviour
|
||||
{
|
||||
public const string URL = "http://192.168.3.103:8089"; // 被注释掉的服务器地址(常量)
|
||||
//public const string URL = "ws://124.221.149.22:38445/safety/cloud"; // 被注释掉的服务器地址(常量)
|
||||
//public class web : MonoBehaviour
|
||||
//{
|
||||
// public const string URL = "http://192.168.3.103:8089"; // 被注释掉的服务器地址(常量)
|
||||
// //public const string URL = "ws://124.221.149.22:38445/safety/cloud"; // 被注释掉的服务器地址(常量)
|
||||
|
||||
// 存储服务器返回的Cookie
|
||||
private static Dictionary<string, string> cookieJar = new Dictionary<string, string>();
|
||||
// // 存储服务器返回的Cookie
|
||||
// private static Dictionary<string, string> cookieJar = new Dictionary<string, string>();
|
||||
|
||||
// 发送HTTP请求的方法,支持GET和POST等不同的请求方式
|
||||
public static async Task<string> SendRequest(string url, string method = "GET", string jsonData = "{}", Dictionary<string, string> head = null)
|
||||
{
|
||||
Debug.Log(url + "启动web"); // 调试输出,启动网络请求
|
||||
// 使用UnityWebRequest类进行HTTP请求,支持自定义请求方法
|
||||
using (UnityWebRequest request = new UnityWebRequest(url, method))
|
||||
{
|
||||
// 设置下载处理器,用于处理服务器响应的数据
|
||||
request.downloadHandler = new DownloadHandlerBuffer();
|
||||
// // 发送HTTP请求的方法,支持GET和POST等不同的请求方式
|
||||
// public static async Task<string> SendRequest(string url, string method = "GET", string jsonData = "{}", Dictionary<string, string> head = null)
|
||||
// {
|
||||
// Debug.Log(url + "启动web"); // 调试输出,启动网络请求
|
||||
// // 使用UnityWebRequest类进行HTTP请求,支持自定义请求方法
|
||||
// using (UnityWebRequest request = new UnityWebRequest(url, method))
|
||||
// {
|
||||
// // 设置下载处理器,用于处理服务器响应的数据
|
||||
// request.downloadHandler = new DownloadHandlerBuffer();
|
||||
|
||||
// 如果是POST请求,设置请求体
|
||||
if (method == "POST" && jsonData != null)
|
||||
{
|
||||
// 将JSON字符串转换为字节数组
|
||||
byte[] bodyRaw = Encoding.UTF8.GetBytes(jsonData);
|
||||
// 设置上传处理器,用于发送请求体数据
|
||||
request.uploadHandler = new UploadHandlerRaw(bodyRaw);
|
||||
// 设置请求头,指定请求体内容类型为JSON
|
||||
request.SetRequestHeader("Content-Type", "application/json");
|
||||
}
|
||||
// // 如果是POST请求,设置请求体
|
||||
// if (method == "POST" && jsonData != null)
|
||||
// {
|
||||
// // 将JSON字符串转换为字节数组
|
||||
// byte[] bodyRaw = Encoding.UTF8.GetBytes(jsonData);
|
||||
// // 设置上传处理器,用于发送请求体数据
|
||||
// request.uploadHandler = new UploadHandlerRaw(bodyRaw);
|
||||
// // 设置请求头,指定请求体内容类型为JSON
|
||||
// request.SetRequestHeader("Content-Type", "application/json");
|
||||
// }
|
||||
|
||||
// 如果请求头部存在,添加请求头部信息
|
||||
if (head != null)
|
||||
foreach (string key in head.Keys)
|
||||
{
|
||||
// 遍历传入的头部字典,逐项设置请求头部
|
||||
request.SetRequestHeader(key, head[key]);
|
||||
}
|
||||
// // 如果请求头部存在,添加请求头部信息
|
||||
// if (head != null)
|
||||
// foreach (string key in head.Keys)
|
||||
// {
|
||||
// // 遍历传入的头部字典,逐项设置请求头部
|
||||
// request.SetRequestHeader(key, head[key]);
|
||||
// }
|
||||
|
||||
// 设置已存储的 Cookie
|
||||
if (cookieJar.Count > 0)
|
||||
{
|
||||
// 用于存储多个cookie值的字符串
|
||||
string cookieHeader = "";
|
||||
foreach (var cookie in cookieJar)
|
||||
{
|
||||
// 格式化每个cookie为“键=值”的形式,并附加到字符串中,以分号分隔
|
||||
cookieHeader += $"{cookie.Key}={cookie.Value}; ";
|
||||
}
|
||||
// 设置请求头中的Cookie字段
|
||||
request.SetRequestHeader("Cookie", cookieHeader);
|
||||
}
|
||||
// // 设置已存储的 Cookie
|
||||
// if (cookieJar.Count > 0)
|
||||
// {
|
||||
// // 用于存储多个cookie值的字符串
|
||||
// string cookieHeader = "";
|
||||
// foreach (var cookie in cookieJar)
|
||||
// {
|
||||
// // 格式化每个cookie为“键=值”的形式,并附加到字符串中,以分号分隔
|
||||
// cookieHeader += $"{cookie.Key}={cookie.Value}; ";
|
||||
// }
|
||||
// // 设置请求头中的Cookie字段
|
||||
// request.SetRequestHeader("Cookie", cookieHeader);
|
||||
// }
|
||||
|
||||
// 发送请求并等待响应
|
||||
var operation = request.SendWebRequest();
|
||||
while (!operation.isDone)
|
||||
await Task.Yield(); // 等待请求完成,使用await以非阻塞的方式处理
|
||||
// // 发送请求并等待响应
|
||||
// var operation = request.SendWebRequest();
|
||||
// while (!operation.isDone)
|
||||
// await Task.Yield(); // 等待请求完成,使用await以非阻塞的方式处理
|
||||
|
||||
// 检查是否存在网络错误或协议错误
|
||||
if (request.result == UnityWebRequest.Result.ConnectionError || request.result == UnityWebRequest.Result.ProtocolError)
|
||||
{
|
||||
// 如果有错误,输出错误信息并返回null
|
||||
Debug.LogError($"Error: {request.error}" + url);
|
||||
// 可以自定义弹窗提示用户错误信息,代码被注释掉了
|
||||
// Promptmgr.Instance.PromptBubble(request.error, Color.black,Color.red);
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 处理返回的Cookie
|
||||
string setCookieHeader;
|
||||
string str = request.downloadHandler.text; // 获取服务器返回的文本内容
|
||||
//Debug.Log(str); // 输出返回内容到控制台
|
||||
// // 检查是否存在网络错误或协议错误
|
||||
// if (request.result == UnityWebRequest.Result.ConnectionError || request.result == UnityWebRequest.Result.ProtocolError)
|
||||
// {
|
||||
// // 如果有错误,输出错误信息并返回null
|
||||
// Debug.LogError($"Error: {request.error}" + url);
|
||||
// // 可以自定义弹窗提示用户错误信息,代码被注释掉了
|
||||
// // Promptmgr.Instance.PromptBubble(request.error, Color.black,Color.red);
|
||||
// return null;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // 处理返回的Cookie
|
||||
// string setCookieHeader;
|
||||
// string str = request.downloadHandler.text; // 获取服务器返回的文本内容
|
||||
// //Debug.Log(str); // 输出返回内容到控制台
|
||||
|
||||
// 尝试获取响应头中的“Set-Cookie”字段
|
||||
if (request.GetResponseHeaders().TryGetValue("Set-Cookie", out setCookieHeader))
|
||||
{
|
||||
// 将“Set-Cookie”字段的内容按分号分隔为多个部分
|
||||
string[] cookies = setCookieHeader.Split(';');
|
||||
foreach (var cookie in cookies)
|
||||
{
|
||||
// 将每个cookie分为“键=值”的形式
|
||||
var cookieParts = cookie.Split('=');
|
||||
if (cookieParts.Length == 2)
|
||||
{
|
||||
string key = cookieParts[0].Trim(); // 去掉键的空格
|
||||
string value = cookieParts[1].Trim(); // 去掉值的空格
|
||||
// 存储到cookieJar中,以备后续请求使用
|
||||
cookieJar[key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
// // 尝试获取响应头中的“Set-Cookie”字段
|
||||
// if (request.GetResponseHeaders().TryGetValue("Set-Cookie", out setCookieHeader))
|
||||
// {
|
||||
// // 将“Set-Cookie”字段的内容按分号分隔为多个部分
|
||||
// string[] cookies = setCookieHeader.Split(';');
|
||||
// foreach (var cookie in cookies)
|
||||
// {
|
||||
// // 将每个cookie分为“键=值”的形式
|
||||
// var cookieParts = cookie.Split('=');
|
||||
// if (cookieParts.Length == 2)
|
||||
// {
|
||||
// string key = cookieParts[0].Trim(); // 去掉键的空格
|
||||
// string value = cookieParts[1].Trim(); // 去掉值的空格
|
||||
// // 存储到cookieJar中,以备后续请求使用
|
||||
// cookieJar[key] = value;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// 返回响应内容(文本形式)
|
||||
return request.downloadHandler.text;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// // 返回响应内容(文本形式)
|
||||
// return request.downloadHandler.text;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
@ -10,7 +10,7 @@ public class bindMaterial : MonoBehaviour
|
||||
// 创建请求头,使用最新的 token
|
||||
public Dictionary<string, string> CreateHeaders()
|
||||
{
|
||||
if (string.IsNullOrEmpty(Global.global.loginResponse.data.access_token))
|
||||
if (string.IsNullOrEmpty(MyGlobal.global.loginResponse.data.access_token))
|
||||
{
|
||||
Debug.LogWarning("尝试创建请求头时,token 未设置。");
|
||||
return new Dictionary<string, string>();
|
||||
@ -18,7 +18,7 @@ public class bindMaterial : MonoBehaviour
|
||||
|
||||
return new Dictionary<string, string>
|
||||
{
|
||||
{ "Authorization","Bearer "+Global.global.loginResponse.data.access_token },
|
||||
{ "Authorization","Bearer "+MyGlobal.global.loginResponse.data.access_token },
|
||||
{"clientId", "e5cd7e4891bf95d1d19206ce24a7b32e" }
|
||||
};
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ public class bindNPC : MonoBehaviour
|
||||
{
|
||||
|
||||
|
||||
if (string.IsNullOrEmpty(Global.global.loginResponse.data.access_token))
|
||||
if (string.IsNullOrEmpty(MyGlobal.global.loginResponse.data.access_token))
|
||||
{
|
||||
Debug.LogWarning("尝试创建请求头时,token 未设置。");
|
||||
return new Dictionary<string, string>();
|
||||
@ -20,7 +20,7 @@ public class bindNPC : MonoBehaviour
|
||||
|
||||
return new Dictionary<string, string>
|
||||
{
|
||||
{ "Authorization","Bearer "+Global.global.loginResponse.data.access_token },
|
||||
{ "Authorization","Bearer "+MyGlobal.global.loginResponse.data.access_token },
|
||||
{"clientId", "e5cd7e4891bf95d1d19206ce24a7b32e" }
|
||||
};
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ public class bindPlayer : MonoBehaviour
|
||||
{
|
||||
|
||||
|
||||
if (string.IsNullOrEmpty(Global.global.loginResponse.data.access_token))
|
||||
if (string.IsNullOrEmpty(MyGlobal.global.loginResponse.data.access_token))
|
||||
{
|
||||
Debug.LogWarning("尝试创建请求头时,token 未设置。");
|
||||
return new Dictionary<string, string>();
|
||||
@ -22,7 +22,7 @@ public class bindPlayer : MonoBehaviour
|
||||
|
||||
return new Dictionary<string, string>
|
||||
{
|
||||
{ "Authorization","Bearer "+Global.global.loginResponse.data.access_token },
|
||||
{ "Authorization","Bearer "+MyGlobal.global.loginResponse.data.access_token },
|
||||
{"clientId", "e5cd7e4891bf95d1d19206ce24a7b32e" }
|
||||
};
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ public class getRoleList : MonoBehaviour
|
||||
{
|
||||
|
||||
|
||||
if (string.IsNullOrEmpty(Global.global.loginResponse.data.access_token))
|
||||
if (string.IsNullOrEmpty(MyGlobal.global.loginResponse.data.access_token))
|
||||
{
|
||||
Debug.LogWarning("尝试创建请求头时,token 未设置。");
|
||||
return new Dictionary<string, string>();
|
||||
@ -19,7 +19,7 @@ public class getRoleList : MonoBehaviour
|
||||
|
||||
return new Dictionary<string, string>
|
||||
{
|
||||
{ "Authorization","Bearer "+Global.global.loginResponse.data.access_token },
|
||||
{ "Authorization","Bearer "+MyGlobal.global.loginResponse.data.access_token },
|
||||
{"clientId", "e5cd7e4891bf95d1d19206ce24a7b32e" }
|
||||
};
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ public class getTemplateList : MonoBehaviour
|
||||
{
|
||||
|
||||
|
||||
if (string.IsNullOrEmpty(Global.global.loginResponse.data.access_token))
|
||||
if (string.IsNullOrEmpty(MyGlobal.global.loginResponse.data.access_token))
|
||||
{
|
||||
Debug.LogWarning("尝试创建请求头时,token 未设置。");
|
||||
return new Dictionary<string, string>();
|
||||
@ -21,7 +21,7 @@ public class getTemplateList : MonoBehaviour
|
||||
|
||||
return new Dictionary<string, string>
|
||||
{
|
||||
{ "Authorization","Bearer "+Global.global.loginResponse.data.access_token },
|
||||
{ "Authorization","Bearer "+MyGlobal.global.loginResponse.data.access_token },
|
||||
{"clientId", "e5cd7e4891bf95d1d19206ce24a7b32e" }
|
||||
};
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ public class querySenceList : MonoBehaviour
|
||||
{
|
||||
|
||||
|
||||
if (string.IsNullOrEmpty(Global.global.loginResponse.data.access_token))
|
||||
if (string.IsNullOrEmpty(MyGlobal.global.loginResponse.data.access_token))
|
||||
{
|
||||
Debug.LogWarning("尝试创建请求头时,token 未设置。");
|
||||
return new Dictionary<string, string>();
|
||||
@ -20,7 +20,7 @@ public class querySenceList : MonoBehaviour
|
||||
|
||||
return new Dictionary<string, string>
|
||||
{
|
||||
{ "Authorization","Bearer "+Global.global.loginResponse.data.access_token },
|
||||
{ "Authorization","Bearer "+MyGlobal.global.loginResponse.data.access_token },
|
||||
{"clientId", "e5cd7e4891bf95d1d19206ce24a7b32e" }
|
||||
};
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ public class querySubjectList : MonoBehaviour
|
||||
{
|
||||
|
||||
|
||||
if (string.IsNullOrEmpty(Global.global.loginResponse.data.access_token))
|
||||
if (string.IsNullOrEmpty(MyGlobal.global.loginResponse.data.access_token))
|
||||
{
|
||||
Debug.LogWarning("尝试创建请求头时,token 未设置。");
|
||||
return new Dictionary<string, string>();
|
||||
@ -20,7 +20,7 @@ public class querySubjectList : MonoBehaviour
|
||||
|
||||
return new Dictionary<string, string>
|
||||
{
|
||||
{ "Authorization","Bearer "+Global.global.loginResponse.data.access_token },
|
||||
{ "Authorization","Bearer "+MyGlobal.global.loginResponse.data.access_token },
|
||||
{"clientId", "e5cd7e4891bf95d1d19206ce24a7b32e" }
|
||||
};
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ public class submitTemplate : MonoBehaviour
|
||||
// 创建请求头,使用最新的 token
|
||||
public Dictionary<string, string> CreateHeaders()
|
||||
{
|
||||
if (string.IsNullOrEmpty(Global.global.loginResponse.data.access_token))
|
||||
if (string.IsNullOrEmpty(MyGlobal.global.loginResponse.data.access_token))
|
||||
{
|
||||
Debug.LogWarning("尝试创建请求头时,token 未设置。");
|
||||
return new Dictionary<string, string>();
|
||||
@ -17,7 +17,7 @@ public class submitTemplate : MonoBehaviour
|
||||
|
||||
return new Dictionary<string, string>
|
||||
{
|
||||
{ "Authorization","Bearer "+Global.global.loginResponse.data.access_token },
|
||||
{ "Authorization","Bearer "+MyGlobal.global.loginResponse.data.access_token },
|
||||
{"clientId", "e5cd7e4891bf95d1d19206ce24a7b32e" }
|
||||
};
|
||||
}
|
||||
|
@ -1,177 +1,177 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
//using Newtonsoft.Json;
|
||||
//using System.Collections;
|
||||
//using System.Collections.Generic;
|
||||
//using UnityEngine;
|
||||
|
||||
public class Global : Singleton<Global>
|
||||
{
|
||||
public static Global global;
|
||||
public loginResponse loginResponse;
|
||||
|
||||
// 创建请求头,使用最新的 token
|
||||
public Dictionary<string, string> CreateHeaders()
|
||||
{
|
||||
|
||||
|
||||
if (string.IsNullOrEmpty(Global.global.loginResponse.data.access_token))
|
||||
{
|
||||
Debug.LogWarning("尝试创建请求头时,token 未设置。");
|
||||
return new Dictionary<string, string>();
|
||||
}
|
||||
|
||||
return new Dictionary<string, string>
|
||||
{
|
||||
{ "Authorization", Global.global.loginResponse.data.access_token }
|
||||
};
|
||||
}
|
||||
//// 创建请求头,使用最新的 token
|
||||
//public Dictionary<string, string> CreateHeaders()
|
||||
//{
|
||||
|
||||
|
||||
// if (string.IsNullOrEmpty(response.data.access_token))
|
||||
// {
|
||||
// Debug.LogWarning("尝试创建请求头时,token 未设置。");
|
||||
// return new Dictionary<string, string>();
|
||||
// }
|
||||
|
||||
// return new Dictionary<string, string>
|
||||
// {
|
||||
// { "Authorization", response.data.access_token }
|
||||
// };
|
||||
//}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class loginResponse : Response
|
||||
{
|
||||
public loginData data;
|
||||
//public string access_token;
|
||||
}
|
||||
public class Response
|
||||
{
|
||||
public int code;
|
||||
public string msg;
|
||||
}
|
||||
public class loginData
|
||||
{
|
||||
public string access_token;
|
||||
public string companyId;
|
||||
public string companyName;
|
||||
public string client_id;
|
||||
public int expire_in;//toling剩余时间
|
||||
public string isCreater;//是否是模板创建者,Y是则跳蓝湖预定演练01页面开始创建模板,N否则跳蓝狐回放1页面
|
||||
}
|
||||
//====================================================
|
||||
//public class TemplateListData: Response
|
||||
//public class Global : Singleton<Global>
|
||||
//{
|
||||
// public string[] data;
|
||||
//}
|
||||
//public class newTemplateData: Response
|
||||
//{
|
||||
// public string data;
|
||||
//}
|
||||
//=================================================================
|
||||
// 根数据类
|
||||
//public class QuerySceneData
|
||||
//{
|
||||
// public int code { get; set; }
|
||||
// public string msg { get; set; }
|
||||
// public List<Scene> data { get; set; }
|
||||
// public static Global global;
|
||||
// public loginResponse loginResponse;
|
||||
|
||||
// // 创建请求头,使用最新的 token
|
||||
// public Dictionary<string, string> CreateHeaders()
|
||||
// {
|
||||
|
||||
|
||||
// if (string.IsNullOrEmpty(Global.global.loginResponse.data.access_token))
|
||||
// {
|
||||
// Debug.LogWarning("尝试创建请求头时,token 未设置。");
|
||||
// return new Dictionary<string, string>();
|
||||
// }
|
||||
|
||||
// return new Dictionary<string, string>
|
||||
// {
|
||||
// { "Authorization", Global.global.loginResponse.data.access_token }
|
||||
// };
|
||||
// }
|
||||
// //// 创建请求头,使用最新的 token
|
||||
// //public Dictionary<string, string> CreateHeaders()
|
||||
// //{
|
||||
|
||||
|
||||
// // if (string.IsNullOrEmpty(response.data.access_token))
|
||||
// // {
|
||||
// // Debug.LogWarning("尝试创建请求头时,token 未设置。");
|
||||
// // return new Dictionary<string, string>();
|
||||
// // }
|
||||
|
||||
// // return new Dictionary<string, string>
|
||||
// // {
|
||||
// // { "Authorization", response.data.access_token }
|
||||
// // };
|
||||
// //}
|
||||
|
||||
|
||||
//}
|
||||
|
||||
//// 场景信息类
|
||||
//public class Scene
|
||||
//{
|
||||
// public string id { get; set; }
|
||||
// public string name { get; set; }
|
||||
// public string type { get; set; }
|
||||
// public string description { get; set; }
|
||||
// public int suitIndustry { get; set; }
|
||||
// public string price { get; set; }
|
||||
// public int companyId { get; set; }
|
||||
// public string status { get; set; }
|
||||
// public string delFlag { get; set; }
|
||||
// public string remark { get; set; }
|
||||
// public string gameName { get; set; }
|
||||
// public string gameType { get; set; }
|
||||
// public string ossId { get; set; }
|
||||
// public List<File> fileList { get; set; }
|
||||
// public string gameStoreroom { get; set; }
|
||||
// public string industryName { get; set; }
|
||||
// public string companyName { get; set; }
|
||||
//}
|
||||
|
||||
//// 文件信息类
|
||||
//public class File
|
||||
//public class loginResponse : Response
|
||||
//{
|
||||
// public string ossId { get; set; }
|
||||
// public string name { get; set; }
|
||||
// public string url { get; set; }
|
||||
// public string originalName { get; set; }
|
||||
// public string fileSuffix { get; set; }
|
||||
// public loginData data;
|
||||
// //public string access_token;
|
||||
//}
|
||||
//=================================================================
|
||||
//public class DrillSubject : Response
|
||||
//public class Response
|
||||
//{
|
||||
// [JsonProperty("data")]
|
||||
// public List<QueryDrillSubjectData> data; // 确保字段名与 JSON 中的匹配
|
||||
// public int code;
|
||||
// public string msg;
|
||||
//}
|
||||
//public class loginData
|
||||
//{
|
||||
// public string access_token;
|
||||
// public string companyId;
|
||||
// public string companyName;
|
||||
// public string client_id;
|
||||
// public int expire_in;//toling剩余时间
|
||||
// public string isCreater;//是否是模板创建者,Y是则跳蓝湖预定演练01页面开始创建模板,N否则跳蓝狐回放1页面
|
||||
//}
|
||||
////====================================================
|
||||
////public class TemplateListData: Response
|
||||
////{
|
||||
//// public string[] data;
|
||||
////}
|
||||
////public class newTemplateData: Response
|
||||
////{
|
||||
//// public string data;
|
||||
////}
|
||||
////=================================================================
|
||||
//// 根数据类
|
||||
////public class QuerySceneData
|
||||
////{
|
||||
//// public int code { get; set; }
|
||||
//// public string msg { get; set; }
|
||||
//// public List<Scene> data { get; set; }
|
||||
////}
|
||||
|
||||
//public class QueryDrillSubjectData
|
||||
//{
|
||||
// public string id;
|
||||
// public string[] sceneIds;
|
||||
// public string sceneNames;
|
||||
// public string name;
|
||||
// public string suitVersion;
|
||||
// public string type;
|
||||
// public string description;
|
||||
// public string price;
|
||||
// public string companyId;
|
||||
// public string status;
|
||||
// public string delFlag;
|
||||
// public string remark;
|
||||
// public string gameName;
|
||||
// public string ossId;
|
||||
// public string fileList;
|
||||
//}
|
||||
//===============================================================
|
||||
////// 场景信息类
|
||||
////public class Scene
|
||||
////{
|
||||
//// public string id { get; set; }
|
||||
//// public string name { get; set; }
|
||||
//// public string type { get; set; }
|
||||
//// public string description { get; set; }
|
||||
//// public int suitIndustry { get; set; }
|
||||
//// public string price { get; set; }
|
||||
//// public int companyId { get; set; }
|
||||
//// public string status { get; set; }
|
||||
//// public string delFlag { get; set; }
|
||||
//// public string remark { get; set; }
|
||||
//// public string gameName { get; set; }
|
||||
//// public string gameType { get; set; }
|
||||
//// public string ossId { get; set; }
|
||||
//// public List<File> fileList { get; set; }
|
||||
//// public string gameStoreroom { get; set; }
|
||||
//// public string industryName { get; set; }
|
||||
//// public string companyName { get; set; }
|
||||
////}
|
||||
|
||||
//public class RoleList
|
||||
//{
|
||||
// public int code; // 与 JSON 中的 "code" 字段对应
|
||||
// public string msg; // 与 JSON 中的 "msg" 字段对应
|
||||
// public List<RoleData> data; // 与 JSON 中的 "data" 字段对应,包含角色的列表
|
||||
//}
|
||||
////// 文件信息类
|
||||
////public class File
|
||||
////{
|
||||
//// public string ossId { get; set; }
|
||||
//// public string name { get; set; }
|
||||
//// public string url { get; set; }
|
||||
//// public string originalName { get; set; }
|
||||
//// public string fileSuffix { get; set; }
|
||||
////}
|
||||
////=================================================================
|
||||
////public class DrillSubject : Response
|
||||
////{
|
||||
//// [JsonProperty("data")]
|
||||
//// public List<QueryDrillSubjectData> data; // 确保字段名与 JSON 中的匹配
|
||||
////}
|
||||
|
||||
//public class RoleData
|
||||
//{
|
||||
// public string id; // 与 JSON 中的 "id" 字段对应
|
||||
// public string roleName; // 与 JSON 中的 "roleName" 字段对应
|
||||
// public string sceneId; // 与 JSON 中的 "sceneId" 字段对应
|
||||
// public int gameName; // 与 JSON 中的 "gameName" 字段对应,注意这里是 int 类型
|
||||
// public string roleAttributions; // 与 JSON 中的 "roleAttributions" 字段对应
|
||||
//}
|
||||
//===================================================================
|
||||
//public class BindPlayer:Response
|
||||
//{
|
||||
// public string data;
|
||||
//}
|
||||
//=============================================================
|
||||
//public class BindNPC : Response
|
||||
//{
|
||||
// public string data;//++++++++++++++++++++++++++++++++++++
|
||||
//}
|
||||
//====================================================
|
||||
//public class BindMaterial : Response
|
||||
//{
|
||||
// public string data;//++++++++++++++++++++++++++++++++++++
|
||||
//}
|
||||
//===================================================
|
||||
//public class SubmitTemplate : Response
|
||||
//{
|
||||
// public string data;//++++++++++++++++++++++++++++++++++++
|
||||
//}
|
||||
////public class QueryDrillSubjectData
|
||||
////{
|
||||
//// public string id;
|
||||
//// public string[] sceneIds;
|
||||
//// public string sceneNames;
|
||||
//// public string name;
|
||||
//// public string suitVersion;
|
||||
//// public string type;
|
||||
//// public string description;
|
||||
//// public string price;
|
||||
//// public string companyId;
|
||||
//// public string status;
|
||||
//// public string delFlag;
|
||||
//// public string remark;
|
||||
//// public string gameName;
|
||||
//// public string ossId;
|
||||
//// public string fileList;
|
||||
////}
|
||||
////===============================================================
|
||||
|
||||
////public class RoleList
|
||||
////{
|
||||
//// public int code; // 与 JSON 中的 "code" 字段对应
|
||||
//// public string msg; // 与 JSON 中的 "msg" 字段对应
|
||||
//// public List<RoleData> data; // 与 JSON 中的 "data" 字段对应,包含角色的列表
|
||||
////}
|
||||
|
||||
////public class RoleData
|
||||
////{
|
||||
//// public string id; // 与 JSON 中的 "id" 字段对应
|
||||
//// public string roleName; // 与 JSON 中的 "roleName" 字段对应
|
||||
//// public string sceneId; // 与 JSON 中的 "sceneId" 字段对应
|
||||
//// public int gameName; // 与 JSON 中的 "gameName" 字段对应,注意这里是 int 类型
|
||||
//// public string roleAttributions; // 与 JSON 中的 "roleAttributions" 字段对应
|
||||
////}
|
||||
////===================================================================
|
||||
////public class BindPlayer:Response
|
||||
////{
|
||||
//// public string data;
|
||||
////}
|
||||
////=============================================================
|
||||
////public class BindNPC : Response
|
||||
////{
|
||||
//// public string data;//++++++++++++++++++++++++++++++++++++
|
||||
////}
|
||||
////====================================================
|
||||
////public class BindMaterial : Response
|
||||
////{
|
||||
//// public string data;//++++++++++++++++++++++++++++++++++++
|
||||
////}
|
||||
////===================================================
|
||||
////public class SubmitTemplate : Response
|
||||
////{
|
||||
//// public string data;//++++++++++++++++++++++++++++++++++++
|
||||
////}
|
177
xiaofang/Assets/Script/login/MyGlobal.cs
Normal file
177
xiaofang/Assets/Script/login/MyGlobal.cs
Normal file
@ -0,0 +1,177 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class MyGlobal : Global
|
||||
{
|
||||
public static MyGlobal global;
|
||||
public loginResponse loginResponse;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
global = this;
|
||||
}
|
||||
|
||||
// 创建请求头,使用最新的 token
|
||||
public Dictionary<string, string> CreateHeaders()
|
||||
{
|
||||
|
||||
|
||||
if (string.IsNullOrEmpty(MyGlobal.global.loginResponse.data.access_token))
|
||||
{
|
||||
Debug.LogWarning("尝试创建请求头时,token 未设置。");
|
||||
return new Dictionary<string, string>();
|
||||
}
|
||||
|
||||
return new Dictionary<string, string>
|
||||
{
|
||||
{ "Authorization", MyGlobal.global.loginResponse.data.access_token }
|
||||
};
|
||||
}
|
||||
//// 创建请求头,使用最新的 token
|
||||
//public Dictionary<string, string> CreateHeaders()
|
||||
//{
|
||||
|
||||
|
||||
// if (string.IsNullOrEmpty(response.data.access_token))
|
||||
// {
|
||||
// Debug.LogWarning("尝试创建请求头时,token 未设置。");
|
||||
// return new Dictionary<string, string>();
|
||||
// }
|
||||
|
||||
// return new Dictionary<string, string>
|
||||
// {
|
||||
// { "Authorization", response.data.access_token }
|
||||
// };
|
||||
//}
|
||||
}
|
||||
public class loginResponse : Response
|
||||
{
|
||||
public loginData data;
|
||||
//public string access_token;
|
||||
}
|
||||
public class Response
|
||||
{
|
||||
public int code;
|
||||
public string msg;
|
||||
}
|
||||
public class loginData
|
||||
{
|
||||
public string access_token;
|
||||
public string companyId;
|
||||
public string companyName;
|
||||
public string client_id;
|
||||
public int expire_in;//toling剩余时间
|
||||
public string isCreater;//是否是模板创建者,Y是则跳蓝湖预定演练01页面开始创建模板,N否则跳蓝狐回放1页面
|
||||
}
|
||||
//====================================================
|
||||
//public class TemplateListData: Response
|
||||
//{
|
||||
// public string[] data;
|
||||
//}
|
||||
//public class newTemplateData: Response
|
||||
//{
|
||||
// public string data;
|
||||
//}
|
||||
//=================================================================
|
||||
// 根数据类
|
||||
//public class QuerySceneData
|
||||
//{
|
||||
// public int code { get; set; }
|
||||
// public string msg { get; set; }
|
||||
// public List<Scene> data { get; set; }
|
||||
//}
|
||||
|
||||
//// 场景信息类
|
||||
//public class Scene
|
||||
//{
|
||||
// public string id { get; set; }
|
||||
// public string name { get; set; }
|
||||
// public string type { get; set; }
|
||||
// public string description { get; set; }
|
||||
// public int suitIndustry { get; set; }
|
||||
// public string price { get; set; }
|
||||
// public int companyId { get; set; }
|
||||
// public string status { get; set; }
|
||||
// public string delFlag { get; set; }
|
||||
// public string remark { get; set; }
|
||||
// public string gameName { get; set; }
|
||||
// public string gameType { get; set; }
|
||||
// public string ossId { get; set; }
|
||||
// public List<File> fileList { get; set; }
|
||||
// public string gameStoreroom { get; set; }
|
||||
// public string industryName { get; set; }
|
||||
// public string companyName { get; set; }
|
||||
//}
|
||||
|
||||
//// 文件信息类
|
||||
//public class File
|
||||
//{
|
||||
// public string ossId { get; set; }
|
||||
// public string name { get; set; }
|
||||
// public string url { get; set; }
|
||||
// public string originalName { get; set; }
|
||||
// public string fileSuffix { get; set; }
|
||||
//}
|
||||
//=================================================================
|
||||
//public class DrillSubject : Response
|
||||
//{
|
||||
// [JsonProperty("data")]
|
||||
// public List<QueryDrillSubjectData> data; // 确保字段名与 JSON 中的匹配
|
||||
//}
|
||||
|
||||
//public class QueryDrillSubjectData
|
||||
//{
|
||||
// public string id;
|
||||
// public string[] sceneIds;
|
||||
// public string sceneNames;
|
||||
// public string name;
|
||||
// public string suitVersion;
|
||||
// public string type;
|
||||
// public string description;
|
||||
// public string price;
|
||||
// public string companyId;
|
||||
// public string status;
|
||||
// public string delFlag;
|
||||
// public string remark;
|
||||
// public string gameName;
|
||||
// public string ossId;
|
||||
// public string fileList;
|
||||
//}
|
||||
//===============================================================
|
||||
|
||||
//public class RoleList
|
||||
//{
|
||||
// public int code; // 与 JSON 中的 "code" 字段对应
|
||||
// public string msg; // 与 JSON 中的 "msg" 字段对应
|
||||
// public List<RoleData> data; // 与 JSON 中的 "data" 字段对应,包含角色的列表
|
||||
//}
|
||||
|
||||
//public class RoleData
|
||||
//{
|
||||
// public string id; // 与 JSON 中的 "id" 字段对应
|
||||
// public string roleName; // 与 JSON 中的 "roleName" 字段对应
|
||||
// public string sceneId; // 与 JSON 中的 "sceneId" 字段对应
|
||||
// public int gameName; // 与 JSON 中的 "gameName" 字段对应,注意这里是 int 类型
|
||||
// public string roleAttributions; // 与 JSON 中的 "roleAttributions" 字段对应
|
||||
//}
|
||||
//===================================================================
|
||||
//public class BindPlayer:Response
|
||||
//{
|
||||
// public string data;
|
||||
//}
|
||||
//=============================================================
|
||||
//public class BindNPC : Response
|
||||
//{
|
||||
// public string data;//++++++++++++++++++++++++++++++++++++
|
||||
//}
|
||||
//====================================================
|
||||
//public class BindMaterial : Response
|
||||
//{
|
||||
// public string data;//++++++++++++++++++++++++++++++++++++
|
||||
//}
|
||||
//===================================================
|
||||
//public class SubmitTemplate : Response
|
||||
//{
|
||||
// public string data;//++++++++++++++++++++++++++++++++++++
|
||||
//}
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8fd26537609bdf14b8eb7d5150ef5262
|
||||
guid: c95c5788b8eb5fd44b68f41206406fbb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
@ -74,7 +74,7 @@ public class login : MonoBehaviour
|
||||
{
|
||||
|
||||
|
||||
if (string.IsNullOrEmpty(Global.global.loginResponse.data.access_token))
|
||||
if (string.IsNullOrEmpty(MyGlobal.global.loginResponse.data.access_token))
|
||||
{
|
||||
Debug.LogWarning("尝试创建请求头时,token 未设置。");
|
||||
return new Dictionary<string, string>();
|
||||
@ -82,7 +82,7 @@ public class login : MonoBehaviour
|
||||
|
||||
return new Dictionary<string, string>
|
||||
{
|
||||
{ "Authorization","Bearer "+Global.global.loginResponse.data.access_token },
|
||||
{ "Authorization","Bearer "+MyGlobal.global.loginResponse.data.access_token },
|
||||
{"clientId", "e5cd7e4891bf95d1d19206ce24a7b32e" }
|
||||
};
|
||||
}
|
||||
|
1
xiaofang/Assets/UnityCommon
Submodule
1
xiaofang/Assets/UnityCommon
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit bd7bc9cfad21045ad385db645eb08b708dde73e2
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 238d5690fe411f84da0c68ad5efd0d81
|
||||
guid: 910847e8e0fbf8d46a30f26382e00051
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
Loading…
Reference in New Issue
Block a user