コード例 #1
0
        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();
        }
コード例 #2
0
        void OnAvatarUpdated(Avatar avatar)
        {
            var uid = avatar.Properties["texture-uid"];

            if (uid != null)
            {
                SetTexture(uid);
            }
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 private void Awake()
 {
     avatar           = GetComponent <Avatar>();
     context          = NetworkScene.Register(this);
     networkSceneRoot = context.scene.transform;
 }
コード例 #5
0
 private void Awake()
 {
     avatar = GetComponent <Avatar>();
 }
コード例 #6
0
 // Start is called before the first frame update
 void Start()
 {
     context = NetworkScene.Register(this);
     avatar  = GetComponent <Avatar>();
 }