protected override void OnInit(Point2D position, object[] args) { int gobId = (int)args[0]; widget = new AvatarView(Parent.Widget); widget.Move(position); widget.Avatar = new Avatar(gobId, Session.Objects); }
protected override void OnInit(Point2D position, object[] args) { var session = Parent.Session; var layers = args.Select(x => session.Resources.GetSprite((int)x)); widget = new AvatarView(Parent.Widget); widget.Move(position); widget.Avatar = new Avatar(layers); }
public void MoveRandomAvatarToPosition(Vector3 pPosition) { int randomAvatarId = getRandomAvatorId(); if (randomAvatarId == -1) { return; } AvatarView avatarView = _avatarAreaManager.GetAvatarView(randomAvatarId); avatarView.Move(pPosition); }
private void OnAvatarAreaClicked(Vector3 pClickPosition) { Debug.Log("ChatLobbyClient: you clicked on " + pClickPosition); AvatarView avatarView = _avatarAreaManager.GetAvatarView(client.data.id); ClientData data = client.data; data.x = pClickPosition.x; data.y = pClickPosition.z; client.data = data; avatarView.Move(pClickPosition); client.Write(new UpdateData(client.data)); }
private void OnClientDataUpdate(ClientData data) { if (_avatarAreaManager.HasAvatarView(data.id)) { AvatarView avatarView = _avatarAreaManager.GetAvatarView(data.id); avatarView.SetSkin((int)data.skinId); avatarView.Move(new Vector3(data.x, 0, data.y)); } else { SpawnAvatar(data); } }