Пример #1
0
    public void SendPlayerStatChangeMessage(PlayerInfo playerInfo, int maxHp, int currentHp, int attack, float speed)
    {
        StatNetworkMessage message = new StatNetworkMessage();

        message.maxHp     = maxHp;
        message.currentHp = currentHp;
        message.attack    = attack;
        message.speed     = speed;

        SentMessageToClient(message, NetworkMessageNumber.msgStatChange, playerInfo);
        //NetworkServer.SendToClient(connectionId, NetworkMessageNumber.msgStatChange, message);
    }
Пример #2
0
    void RecieveStatsChange(NetworkMessage message)
    {
        StatNetworkMessage msg  = message.ReadMessage <StatNetworkMessage>();
        PlayerStatMobile   stat = new PlayerStatMobile(
            msg.maxHp,
            msg.currentHp,
            msg.attack,
            msg.speed
            );

        GameManagerMobile.Instance.PlayerStatChange(stat);
    }