Beispiel #1
0
    public void SuffleAll()
    {
        SWNetworkMessage msg = new SWNetworkMessage();

        msg.Push(status);
        remoteEventAgent.Invoke("suffle", msg);
    }
Beispiel #2
0
    public void Fire()
    {
        float            randomAngle = Random.Range(-1 * AttackRandomAngle, AttackRandomAngle);
        SWNetworkMessage message     = new SWNetworkMessage();

        message.Push(randomAngle);
        remoteEventAgent.Invoke(FIRE, message);
    }
    void FireBullet()
    {
        SWNetworkMessage msg = new SWNetworkMessage();

        msg.Push(launchPosition.position);
        msg.Push(transform.forward);
        msg.PushUTF8ShortString(NetworkClient.Instance.PlayerId);
        remoteEventAgent.Invoke("fire", msg);
    }
Beispiel #4
0
    void Fire()
    {
        shoot.FireBullet(movement.FaceRight);

        SWNetworkMessage message = new SWNetworkMessage();

        message.Push(movement.FaceRight);
        remoteEventAgent.Invoke(FIRE, message);
    }
Beispiel #5
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetMouseButtonUp(0) && networkID.IsMine)
        {
            Vector3 targetPosition = Camera.main.ScreenToWorldPoint(Input.mousePosition + Vector3.forward * teleportDistance);

            SWNetworkMessage message = new SWNetworkMessage();
            message.Push(targetPosition);

            remoteEventAgent.Invoke(TELEPORT, message);
        }
    }
Beispiel #6
0
    public void OnHpChanged()
    {
        // Update the hpSlider when player hp changes
        currentHP      = syncPropertyAgent.GetPropertyWithName("hp").GetIntValue();
        hpSlider.value = currentHP;

        if (currentHP == 0)
        {
            // invoke the "killed" remote event when hp is 0.
            if (networkId.IsMine)
            {
                remoteEventAgent.Invoke("killed");
            }
        }
    }