using UnityEngine;
using System.Collections;
using TNet;
[RequireComponent
(typeof(TNObject
))] public class TestingSync : TNBehaviour {
private int someStat = 1;
void FixedUpdate()
{
someStat += 1;
}
void OnNetworkPlayerJoin(Player p)
{
Debug.Log (p+"has joined");
if (TNManager.isHosting)
{
tno.Send(1, p ,this.someStat);
}
}
[RFC(1)]
void SyncStat(int sentStat)
{
this.someStat = sentStat;
}
void OnGUI()
{
GUILayout.Label("SOMESTAT: "+someStat, myStyle);
}
}