private void RenderAvatar(Config config) { if (!avatarManager && !TryGetAvatarManager(out avatarManager)) { return; } if (avatarRenderCommandBufferTmp == null) { avatarRenderCommandBufferTmp = new CommandBuffer(); } avatarTmp = avatarManager.LocalAvatar; avatarRenderCommandBufferTmp.Clear(); // We could gather renderers only once, but it fails if materials are swapped avatarTmp.GetComponentsInChildren <Renderer>(avatarRenderersTmp); for (int i = 0; i < avatarRenderersTmp.Count; i++) { avatarRenderCommandBufferTmp.DrawRenderer( avatarRenderersTmp[i], avatarRenderersTmp[i].material); } mirrorCamera.RemoveAllCommandBuffers(); mirrorCamera.AddCommandBuffer(CameraEvent.BeforeForwardOpaque, avatarRenderCommandBufferTmp); mirrorCamera.cullingMask = 0; mirrorCamera.Render(); }
void OnAvatarUpdated(Avatar avatar) { var uid = avatar.Properties["texture-uid"]; if (uid != null) { SetTexture(uid); } }
private Texture2D cached; // Cache for GetTexture. Do not do anything else with this; use the uuid private void Awake() { avatar = GetComponent <Avatar>(); avatar.OnPeerUpdated.AddListener(OnPeerUpdated); }
private void Awake() { avatar = GetComponent <Avatar>(); context = NetworkScene.Register(this); networkSceneRoot = context.scene.transform; }
private void Awake() { avatar = GetComponent <Avatar>(); }
// Start is called before the first frame update void Start() { context = NetworkScene.Register(this); avatar = GetComponent <Avatar>(); }