public static PlayerClient New(Protocol.Player data) { PlayerClient player = new PlayerClient() { id = data.Id, playerName = data.Name, }; Transform parent = PlayerManagerClient.Instance.transform; player.mAvatar = AvatarClient.New(data.Id, player.local, parent); return(player); }
public static AvatarClient New(int id, bool local, Transform parent) { AvatarClient avatar = new AvatarClient(); avatar.id = id; avatar.local = local; var prefab = Resources.Load("Prototype/Avatar"); GameObject go = (GameObject)GameObject.Instantiate(prefab, Vector3.zero, Quaternion.identity, parent); avatar.mGameObject = go; avatar.mCommon = go.GetComponent <AvatarCommon>(); avatar.mKinematics = avatar.AddComponent <KinematicsClient>(0); SyncManagerClient.Instance.Add(avatar); return(avatar); }
public override void Init(int id, AvatarClient avatar) { base.Init(id, avatar); }
public virtual void Init(int id, AvatarClient avatar) { this.id = id; this.avatar = avatar; }