コード例 #1
0
        public void SceneDefinitionChanged(Scene scene)
        {
            // re-match bone names with the next update
            boneList = null;

            actor = scene.FindActor(actorName);
            if (actor != null)
            {
                Debug.Log("MoCapModel '" + this.name + "' controlled by MoCap actor '" + actorName + "'.");
            }
            else
            {
                Debug.LogWarning("MoCapModel '" + this.name + "' cannot find MoCap actor '" + actorName + "'.");
            }
        }
コード例 #2
0
        public void SceneDefinitionChanged(Scene scene)
        {
            // actor has changed > rebuild hierarchy on next update
            if (rootNode != null)
            {
                // if necessary, destroy old container
                this.transform.parent = rootNode.transform.parent;
                GameObject.Destroy(rootNode);
                rootNode = null;
            }

            Actor actor = scene.FindActor(actorName);

            if (actor != null)
            {
                if (boneName.Length > 0)
                {
                    controllingBone = actor.FindBone(boneName);
                }
                if (controllingBone == null)
                {
                    // not found, or not defined > use root bone
                    Debug.Log("MoCap Object '" + this.name + "' controlled by MoCap actor '" + actor.name + "'.");
                    controllingBone = actor.bones[0];
                }
                else
                {
                    Debug.Log("MoCap Object '" + this.name + "' controlled by MoCap actor/bone '" +
                              actor.name + "/" + controllingBone.name + "'.");
                }
                this.gameObject.SetActive(true);
            }
            else
            {
                if (!notFoundWarningIssued)
                {
                    Debug.LogWarning("Mocap Object '" + this.name + "' cannot find MoCap actor '" + actorName + "'.");
                    notFoundWarningIssued = true;                     // shut up now
                }
                if (trackingLostBehaviour == TrackingLostBehaviour.Disable)
                {
                    // MoCap Actor not found at all > time to disable object?
                    this.gameObject.SetActive(false);
                }
            }
        }
コード例 #3
0
        public void SceneDefinitionChanged(Scene scene)
        {
            // actor has changed > rebuild skeleton on next update
            if (skeletonNode != null)
            {
                // if necessary, destroy old container
                GameObject.Destroy(skeletonNode);
                skeletonNode = null;
            }

            actor = scene.FindActor(actorName);
            if (actor != null)
            {
                Debug.Log("Skeleton Renderer '" + this.name + "' controlled by MoCap actor '" + actorName + "'.");
            }
            else
            {
                Debug.LogWarning("Skeleton Renderer '" + this.name + "' cannot find MoCap actor '" + actorName + "'.");
            }
        }
コード例 #4
0
		public void SceneChanged(Scene scene)
		{
			// re-match bone names with the next update
			dataBuffers = null;

			actor = scene.FindActor(actorName);
			if (actor != null)
			{
				Debug.Log("MoCapModel '" + this.name + "' controlled by MoCap actor '" + actorName + "'.");
			}
			else
			{
				Debug.LogWarning("MoCapModel '" + this.name + "' cannot find MoCap actor '" + actorName + "'.");
			}
		}
コード例 #5
0
		public void SceneChanged(Scene scene)
		{
			// actor has changed > rebuild skeleton on next update
			if (skeletonNode != null)
			{
				// if necessary, destroy old container
				GameObject.Destroy(skeletonNode);
				skeletonNode = null;
			}

			actor = scene.FindActor(actorName);
			if (actor != null)
			{
				Debug.Log("Skeleton Renderer '" + this.name + "' controlled by MoCap actor '" + actorName + "'.");
			}
			else
			{
				Debug.LogWarning("Skeleton Renderer '" + this.name + "' cannot find MoCap actor '" + actorName + "'.");
			}
		}
コード例 #6
0
		public void SceneChanged(Scene scene)
		{
			// actor has changed > rebuild hierarchy on next update
			if (rootNode != null)
			{
				// if necessary, destroy old container
				this.transform.parent = rootNode.transform.parent;
				GameObject.Destroy(rootNode);
				rootNode = null;
			}

			Actor actor = scene.FindActor(actorName);
			if (actor != null)
			{
				if (boneName.Length > 0)
				{
					controllingBone = actor.FindBone(boneName);
				}
				if (controllingBone == null)
				{
					// not found, or not defined > use root bone
					Debug.Log("MoCap Object '" + this.name + "' controlled by MoCap actor '" + actorName + "'.");
					controllingBone = actor.bones[0];
				}
				else
				{
					Debug.Log("MoCap Object '" + this.name + "' controlled by MoCap actor/bone '" +
						actorName + "/" + controllingBone.name + "'.");
				}
			}
			else
			{
				Debug.LogWarning("Mocap Object '" + this.name + "' cannot find MoCap actor '" + actorName + "'.");
				if (trackingLostBehaviour == TrackingLostBehaviour.Disable)
				{
					// MoCap Actor not found at all > time to disable object?
					this.gameObject.SetActive(false);
				}
			}
		}