using UnityEngine;
using System.Collections;
public class NewBehaviourScript : MonoBehaviour {
Vector3 lastPos;
Quaternion lastRot;
void Awake()
{
if(!networkView.isMine)
{
// enabled = false;
}
}
void Update()
{
if(lastRot != transform.position)
{
lastRot = transform.position
(networkView.RPC(“UpdatePos”,
RPCMode.AllBuffered,
transform.position transform.rotation))
}
if(lastRot != transform.rotation)
{
lastRot = transform.rotation
(networkView.RPC(“UpdatePos”,
RPCMode.AllBuffered,
transform.position transform.rotation))
}
}
[RPC]
void UpdatePos(Vector3 pos, Quaternion rot)
{
if (!networkView.isMine)
{
transform.position = pos;
transform.rotation = rot;
}
}
}