Esempio n. 1
0
        //=============================
        // this is run once at startup
        //=============================
        void Start()
        {
            networkPlugin = GetComponent <CapturyNetworkPlugin>();
            if (networkPlugin == null)
            {
                Debug.LogError("No CapturyNetworkPlugin attached to " + name);
            }

            leapProvider = FindObjectOfType <LeapProvider>();
            if (leapProvider == null)
            {
                Debug.LogError("No LeapProvider in Scene");
            }
        }
Esempio n. 2
0
        // Use this for initialization
        void Start()
        {
            networkPlugin = GetComponent <CapturyNetworkPlugin>();

            // find CapturyOrigin to define spawn position of avatars
            capturyOrigin = FindObjectOfType <CapturyOrigin>();
            if (capturyOrigin == null)
            {
                // create origin at world origin if none exists
                capturyOrigin = CreateCapturyOrigin();
            }
            CapturyOriginChanged(capturyOrigin);

            // register for scene change events
            SceneManager.activeSceneChanged += OnActiveSceneChanged;
        }
Esempio n. 3
0
        private void Start()
        {
            // get config
            capturyConfig = CapturyConfigManager.Config;

            networkPlugin          = GetComponent <CapturyNetworkPlugin>();
            capturyLeapIntegration = GetComponent <CapturyLeapIntegration>();

            if (transformFollower == null)
            {
                transformFollower = FindObjectOfType <TransformFollower>();
                if (transformFollower == null)
                {
                    Debug.LogError("No TransformFollower found in Scene. Camera manipulation by Captury tracking won't work.");
                }
            }

            // check the avatar prefabs
            if (defaultAvatar == null)
            {
                Debug.LogError("defaultAvatar not set. Make sure you assign a Avatar prefab to CapturyAvatarManager.defaultAvatar");
            }/* else
              * ConvertGameObjectToCapturyActor(defaultAvatar);*/
            if (localAvatarPrefabs.Length != remoteAvatarPrefabs.Length)
            {
                Debug.LogError("localAvatarPrefabs.Length != remoteAvatarPrefabs.Length. For every localAvatarPrefab (without head) there has to be a remoteAvatarPrefab (with head) which will be spawned on remote experiences");
            }

            // keep the CapturyAvatarManager GameObject between scenes
            DontDestroyOnLoad(gameObject);

            // register for skeleton events
            networkPlugin.SkeletonFound += OnSkeletonFound;
            networkPlugin.SkeletonLost  += OnSkeletonLost;
            // register for AR Tag (marker) events
            networkPlugin.ARTagsDetected += OnARTagsDetected;
        }