Esempio n. 1
0
    void HandleAttack(SocketIOEvent e)
    {
        //Debug.Log("handleAttack");
        //Debug.Log(e.data);
        PlayerAttackStruct attackMessage  = JsonUtility.FromJson <PlayerAttackStruct>(e.data);
        Vector3            turretRotation = new Vector3(attackMessage.x, attackMessage.y, attackMessage.z);

        GameManager.instance.OnPlayerAttack(attackMessage.id, attackMessage.force, turretRotation);
    }
Esempio n. 2
0
    public void NotifyPlayerAttack(string playerId, float force, Vector3 turretRotation)
    {
        PlayerAttackStruct attackMessage = new PlayerAttackStruct(playerId, turretRotation.x, turretRotation.y, turretRotation.z, force);

        io.Emit("attack", JsonUtility.ToJson(attackMessage));
    }