本文整理汇总了C#中GameMessage类的典型用法代码示例。如果您正苦于以下问题:C# GameMessage类的具体用法?C# GameMessage怎么用?C# GameMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GameMessage类属于命名空间,在下文中一共展示了GameMessage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MessageNode
public MessageNode(GameMessage message, int start, int end)
{
this.gameMessage = message;
this.mStart = start;
this.mEnd = end;
Text = String.Join(".", (message.GetType().ToString().Split('.').Skip(5)));
}
示例2: GameServerPacket
public GameServerPacket(GameMessage message)
{
m_stream = new MemoryStream();
m_writer = new BinaryWriter(m_stream);
m_writer.Write((byte)(StocMessage.GameMsg));
m_writer.Write((byte)message);
}
示例3: BroadcastGlobal
public void BroadcastGlobal(GameMessage message)
{
foreach (var player in this.Players.Values)
{
player.InGameClient.SendMessageNow(message);
}
}
示例4: Message_TouchStarted
public GameMessageResult Message_TouchStarted(GameMessage msg)
{
ToggleSelected();
GameMessenger.Reg("touchEnded", this, Message_TouchEnded);
GameMessenger.Reg("touchMoved", this, Message_TouchMoved);
return GameMessageResult.handledMessage;
}
示例5: Message_newTestInputRecording
public GameMessageResult Message_newTestInputRecording(GameMessage msg)
{
var testName = (string)msg.data;
text.text = "[Test] " + testName;
Clear();
return GameMessageResult.handledMessage;
}
示例6: HoldEnd
public void HoldEnd (GameMessage msg)
{
Debug.Log("HoldEnd");
// TODO(oz) Differenciate hold end from hold start
ChangeBehaviour(Behaviour.HoldStart);
SoundController.instance.PlaySfx (SoundController.SfxType.FxTams2, msg.targetId);
}
示例7: GameServerPacket
public GameServerPacket(GameMessage message):base(GamePacketByteLength)
{
Write((byte)(StocMessage.GameMsg));
this.PacketMsg=StocMessage.GameMsg;
Write((byte)message);
this.GameMsg = message;
}
示例8: OnGameMessage
public override void OnGameMessage(GameMessage gameMessage)
{
//requestedState = gameMessage.unityInstanceStatus.requestedState;
gameMessage.unityInstanceStatus.state = gameMessage.unityInstanceStatus.requestedState;
Reply(gameMessage);
}
示例9: Log
public static void Log(string txt, float life = 3.0f){
GameMessage msg = new GameMessage ();
msg.text = txt;
msg.time = Time.time;
msg.life = life;
message_stream.OnNext(msg);
}
示例10: EmtryMessage
public static byte[] EmtryMessage(GameMessage message){
byte[] data =null;
using(GameServerPacket packet=new GameServerPacket(message)){
data = packet.Content;
}
return data;
}
示例11: CreateAccount
public static PacketWriter CreateAccount(bool successful, GameMessage failureReason)
{
var pw = GetWriter(ServerPacketID.CreateAccount);
pw.Write(successful);
if (!successful)
pw.WriteEnum(failureReason);
return pw;
}
示例12: Send
/// <summary>
/// Sends data to the <see cref="INetworkSender"/>. This method is thread-safe.
/// </summary>
/// <param name="sender">The <see cref="INetworkSender"/> to use to send the data.</param>
/// <param name="message">GameMessage to send to the User.</param>
/// <param name="messageType">The <see cref="ServerMessageType"/> to use for sending the <paramref name="message"/>.</param>
/// <param name="parameters">Message parameters.</param>
public static void Send(this INetworkSender sender, GameMessage message, ServerMessageType messageType,
params object[] parameters)
{
using (var pw = ServerPacket.SendMessage(message, parameters))
{
sender.Send(pw, messageType);
}
}
示例13: CoreMessage
public CoreMessage(GameMessage msg, BinaryReader reader, byte[] raw)
{
Message = msg;
Reader = reader;
m_raw = raw;
m_stream = (MemoryStream)reader.BaseStream;
m_startPosition = m_stream.Position;
}
示例14: getMessage
public override GameMessage getMessage()
{
GameMessage message = new GameMessage ();
message.bPieceSelectionMessage = false;
message.iIndex1 = (int)squareIndex.x;
message.iIndex2 = (int)squareIndex.y;
return message;
}
示例15: DespawnMessage
public static GameMessage DespawnMessage(int index)
{
GameMessage msg = new GameMessage();
msg.DataType = DataTypeDespawnEntity;
msg.index = index;
msg.MessageSize = 0;
return msg;
}