Ejemplo n.º 1
0
    public override void Drop(RpcArgs args)
    {
        uint playerID = args.GetNext <uint>();

        Player p = GameLogic.GetPlayerByID(playerID);

        p.networkObject.SendRpc(Player.RPC_ADD_SCORE, Receivers.AllBuffered, 1);
        BMSLogger.DebugLog("Player scored : " + playerID);
    }
Ejemplo n.º 2
0
    // ------------------------------------------------------------------------

    private void Start()
    {
        Instance = this;

        var player = NetworkManager.Instance.InstantiatePlayer(position: StartPos);

        PlayerTransform = player.transform;

        BMSLogger.DebugLog("Player " + player.networkObject.NetworkId + " joined the game");
    }
Ejemplo n.º 3
0
    public override void Push(RpcArgs args)
    {
        lastPlayerIDTouched = args.GetNext <uint>();
        Vector2 dir = args.GetNext <Vector2>();

        if (lastPlayerIDTouched == 0)
        {
            return;
        }

        BMSLogger.DebugLog("-- push rpc by " + lastPlayerIDTouched + " --");
        rb2d.AddForce(dir, ForceMode2D.Impulse);
    }
Ejemplo n.º 4
0
    void CheckAndRespawnItems()
    {
        int itemNb    = GameObject.FindObjectsOfType <PickableItem>().Length;
        int newItemNb = maxItems - itemNb;

        for (int i = 0; i < newItemNb; i++)
        {
            BMSLogger.DebugLog("Spawning 1 item");
            var item = NetworkManager.Instance.InstantiatePickableItem(
                position: generateRd(15, 15, 3, 3, new Vector3(0.06f, 3.41f)));
            //position:new Vector3(Random.Range(-10, 10), Random.Range(-20, -5)));
        }
    }