示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
 public override void Init(int id, AvatarClient avatar)
 {
     base.Init(id, avatar);
 }
示例#4
0
 public virtual void Init(int id, AvatarClient avatar)
 {
     this.id     = id;
     this.avatar = avatar;
 }