浏览代码

code clean up, aded gets and setters and tooltips

/BodyRecording
Dan 4 年前
当前提交
65744681
共有 8 个文件被更改,包括 135 次插入19 次删除
  1. 10
      Assets/BodyRecording/Scripts/BodyEditorRecorder.cs
  2. 18
      Assets/BodyRecording/Scripts/BodyFileReader.cs
  3. 18
      Assets/BodyRecording/Scripts/BodyPlayback.cs
  4. 31
      Assets/BodyRecording/Scripts/BodyRecordingUIManager.cs
  5. 16
      Assets/BodyRecording/Scripts/BodyRuntimeRecorder.cs
  6. 8
      Assets/BodyRecording/Scripts/JointHandler.cs
  7. 51
      Assets/BodyRecording/Scripts/TrackingManager.cs
  8. 2
      ProjectSettings/ProjectSettings.asset

10
Assets/BodyRecording/Scripts/BodyEditorRecorder.cs


public class BodyEditorRecorder : MonoBehaviour
{
[SerializeField]
[Tooltip("Unity animation clip that will be OVERWRITTEN and written to if 'Record to Animation clip' is true in Body Playback component")]
public AnimationClip clip
{
get => m_Clip;
set => m_Clip = value;
}
#if UNITY_EDITOR
GameObjectRecorder m_Recorder;

18
Assets/BodyRecording/Scripts/BodyFileReader.cs


[SerializeField]
[Tooltip("Path to folder that contains the BodyCaptureData.txt, must be in the Project's Asset folder")]
string m_CapturesFolderPath = "/Assets/BodyRecording/Captures/";
public string capturesFolderPath
{
get => m_CapturesFolderPath;
set => m_CapturesFolderPath = value;
}
public string fileName
{
get => m_FileName;
set => m_FileName = value;
}
public string postFilePath
{
get => m_PostFilePath;
set => m_PostFilePath = value;
}
BodyRuntimeRecorder m_BodyRuntimeRecorder;
List<Vector3> m_PositionValues = new List<Vector3>();

18
Assets/BodyRecording/Scripts/BodyPlayback.cs


public class BodyPlayback : MonoBehaviour
{
[SerializeField]
[Tooltip("Is this playback happening in AR or In the Editor")]
bool m_InEditor;
public bool inEditor

}
[SerializeField]
[Tooltip("True if the animation is currently playing")]
public bool playingAnimation
{
get => m_PlayingAnimation;
set => m_PlayingAnimation = value;
}
[Tooltip("True if you want to save the captured animation to a Unity animation clip")]
public bool recordToAnimationClip
{
get => m_RecordToAnimationClip;
set => m_RecordToAnimationClip = value;
}
int m_JointIndex = 0;
List<Vector3> m_JointPositions;

31
Assets/BodyRecording/Scripts/BodyRecordingUIManager.cs


public class BodyRecordingUIManager : MonoBehaviour
{
[SerializeField]
[Tooltip("Human body manager reference")]
public ARHumanBodyManager humanBodyManager
{
get => m_HumanBodyManager;
set => m_HumanBodyManager = value;
}
[Tooltip("Body tracking UI reference")]
public GameObject bodyTrackingUI
{
get => m_BodyTrackingUI;
set => m_BodyTrackingUI = value;
}
[Tooltip("World tracking UI reference")]
public GameObject worldTrackingUI
{
get => m_WorldTrackingUI;
set => m_WorldTrackingUI = value;
}
[Tooltip("Button for playing back captured animation")]
public Button animationPlayButton
{
get => m_AnimationPlayButton;
set => m_AnimationPlayButton = value;
}
void OnEnable()
{
m_HumanBodyManager.humanBodiesChanged += HumanBodyManagerOnhumanHumanBodiesChanged;

16
Assets/BodyRecording/Scripts/BodyRuntimeRecorder.cs


public class BodyRuntimeRecorder : MonoBehaviour
{
bool m_IsRecording = false;
bool m_FirstRotation = false;
int m_CurrentJoint = 0;
Pose m_BodyAnchorPose;
Quaternion m_AlightmentRotation;
List<Vector3> m_JointPositions;
public List<Vector3> JointPositions

public event Action dataRecorded;
[SerializeField]
[Tooltip("Human body manager reference")]
public ARHumanBodyManager humanBodyManager
{
get => m_HumanBodyManager;

JointHandler m_ActiveTrackedBodyJoints;
static int s_TrackedBodyJointCount = 92; // 91 + root parent
const int k_TrackedBodyJointCount = 92; // 91 + root parent
void OnEnable()
{
m_HumanBodyManager.humanBodiesChanged += HumanBodyManagerOnhumanBodiesChanged;

{
if (m_IsRecording)
{
for (int i = 0; i < s_TrackedBodyJointCount; i++)
for (int i = 0; i < k_TrackedBodyJointCount; i++)
{
if (i == 0)
{

8
Assets/BodyRecording/Scripts/JointHandler.cs


public class JointHandler : MonoBehaviour
{
[Tooltip("Root joint at root of rig skeleton, should be named Root_1")]
public Transform skeletonRoot
{
get => m_SkeletonRoot;
set => m_SkeletonRoot = value;
}
public List<Transform> Joints { get; set; }
void OnEnable()

51
Assets/BodyRecording/Scripts/TrackingManager.cs


}
[SerializeField]
[Tooltip("Current tracking state")]
public CurrentTrackingState trackingState
{
get => m_TrackingState;
set => m_TrackingState = value;
}
[Tooltip("Plane manager reference")]
public ARPlaneManager planeManager
{
get => m_PlaneManager;
set => m_PlaneManager = value;
}
[Tooltip("PointCloud manager reference")]
public ARPointCloudManager pointCloudManager
{
get => m_PointCloudManager;
set => m_PointCloudManager = value;
}
[Tooltip("Raycast manager reference")]
public ARRaycastManager raycastManager
{
get => m_RaycastManager;
set => m_RaycastManager = value;
}
[Tooltip("Human body manager reference")]
public ARHumanBodyManager humanBodyManager
{
get => m_HumanBodyManager;
set => m_HumanBodyManager = value;
}
[Tooltip("Place objects on plane reference")]
public PlaceObjectsOnPlane placeObjectsOnPlane
{
get => m_PlaceObjectsOnPlane;
set => m_PlaceObjectsOnPlane = value;
}
[Tooltip("UI manager reference")]
public UIManager uiManager
{
get => m_UIManger;
set => m_UIManger = value;
}
bool m_FirstWorldTracking = true;
*/

m_RaycastManager.enabled = true;
m_PlaceObjectsOnPlane.enabled = true;
m_TrackingState = CurrentTrackingState.WorldTracking;
Debug.Log("thing");
// show instructional UI is enabling world tracking for the first time
/*

2
ProjectSettings/ProjectSettings.asset


bundleVersion: 0.1
preloadedAssets:
- {fileID: 4800000, guid: c9f956787b1d945e7b36e0516201fc76, type: 3}
- {fileID: 4800000, guid: e7c77f6eaab324a819efdc13b8125a39, type: 3}
- {fileID: -5347491848479676215, guid: 5c86decb01f9d6b46a50ce486fba0042, type: 2}
metroInputSource: 0
wsaTransparentSwapchain: 0
m_HolographicPauseOnTrackingLoss: 1

正在加载...
取消
保存