using UnityEngine;
using System.Collections;
using TNet;
public class GamePlayer : TNBehaviour {
static public GamePlayer instance;
Vector3 mTarget = Vector3.zero;
public Vector3 target{
set {
tno.Send("onSetTarget",Target.AllSaved,value);
}
}
void Awake(){
if(TNManager.isThisMyObject) {
instance = this;
}
}
void Update(){
transform.position = Vector3.MoveTowards(transform.position,mTarget, 3f * Time.deltaTime);
}
void OnNetworkPlayerJoin(Player p){
tno.Send("onSetTargetImediate",p,transform.position);
}
[RFC]
void onSetTarget( Vector3 pos){
mTarget = pos;
}
[RFC]
void onSetTargetImediate(Vector3 pos){
transform.position = pos;
}
}