コード例 #1
0
ファイル: VoipAvatar.cs プロジェクト: UCL-VR/ubiq
 private void Start()
 {
     peerConnectionManager = NetworkScene.FindNetworkScene(this).
                             GetComponentInChildren <VoipPeerConnectionManager>();
     if (peerConnectionManager)
     {
         peerConnectionManager.OnPeerConnection.AddListener(OnPeerConnection, true);
     }
 }
コード例 #2
0
 /// <summary>
 /// Find the AvatarManager for forest the Component is a member of. May return null if there is no AvatarManager for the scene.
 /// </summary>
 public static AvatarManager Find(MonoBehaviour Component)
 {
     try
     {
         return(NetworkScene.FindNetworkScene(Component).GetComponentInChildren <AvatarManager>());
     }
     catch
     {
         return(null);
     }
 }
コード例 #3
0
 /// <summary>
 /// Find the VoipConnectionManager for forest the Component is a member of. May return null if there is no Voip manager for the scene.
 /// </summary>
 public static VoipPeerConnectionManager Find(MonoBehaviour Component)
 {
     try
     {
         return(NetworkScene.FindNetworkScene(Component).GetComponentInChildren <VoipPeerConnectionManager>());
     }
     catch
     {
         return(null);
     }
 }
コード例 #4
0
        private bool TryGetAvatarManager(out AvatarManager avatarManager)
        {
            try {
                avatarManager = NetworkScene.FindNetworkScene(this)
                                .GetComponentInChildren <AvatarManager>();
            }
            catch (System.NullReferenceException)
            {
                avatarManager = null;
            }

            return(avatarManager);
        }
コード例 #5
0
        private void SetTexture(Texture2D texture)
        {
            if (!networkScene)
            {
                networkScene = NetworkScene.FindNetworkScene(this);
                if (!networkScene)
                {
                    return;
                }
            }

            var avatar         = networkScene.GetComponentInChildren <AvatarManager>().LocalAvatar;
            var texturedAvatar = avatar.GetComponent <TexturedAvatar>();

            if (texturedAvatar)
            {
                texturedAvatar.SetTexture(texture);
            }
        }
コード例 #6
0
        public static void ChangeScene(MonoBehaviour caller, string sceneName)
        {
            var manager = FindSceneManager(NetworkScene.FindNetworkScene(caller));

            manager.ChangeScene(sceneName);
        }
コード例 #7
0
ファイル: NetworkSpawner.cs プロジェクト: AriaTZY/MonopolyVR
        public static GameObject SpawnPersistent(MonoBehaviour caller, GameObject prefab)
        {
            var spawner = FindNetworkSpawner(NetworkScene.FindNetworkScene(caller));

            return(spawner.SpawnPersistent(prefab));
        }