Example #1
0
    public void rpcPulsePositions(int[] IDs, Vector3[] targetPositions,
                                  Quaternion[] targetRots, Vector3[] targetVels, float[] originLifeTimes)
    {
        //Debug.LogError("NetPosition pulse received! with size " + IDs.Length);

        for (int i = 0; i < IDs.Length; i++)
        {
            PhotonView currentView = PhotonNetwork.GetPhotonView(IDs[i]);


            //Debug.LogWarning("============  Entering rpc pulse loop iteration");
            if (currentView != null && IDs[i] != -1) // the -1 check may be reduntant. Leaving it in just in case
            {
                NetPosition currentNetPosition = currentView.GetComponent <NetPosition>();

                //Debug.LogWarning("************ photonView found, updating current position");
                currentNetPosition.updatePositionAndVelocity(targetPositions[i], targetRots[i], targetVels[i], originLifeTimes[i]);
            }
        }
    }