public class RPCHit : Photon.MonoBehaviour {
public HealthScript hs;
public float Health;
// Use this for initialization
void Start () {
//hs = GetComponent<HealthScript> ();
}
// Update is called once per frame
void Update () {
if (!photonView.isMine) {
hs.health = Health;
}
if (photonView.isMine) {
Health = hs.health;
}
}
public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info){
if (stream.isWriting) {
stream.SendNext (Health);
} else if (stream.isReading) {
Health = (float)stream.ReceiveNext();
}
}
}