void Awake() { this.rootCapsuleCollider = this.GetComponent <CapsuleCollider>(); this.capsuleColliders = this.GetComponentsInChildren <CapsuleCollider>().ToList(); this.capsuleColliders.Remove(this.rootCapsuleCollider); this.simpleHumanVRController = this.GetComponentInChildren <SimpleHumanVRController>(); this.simpleIK = this.GetComponentInChildren <SimpleIK>(); this.cleanupAvatarVRHandControllers = this.GetComponentsInChildren <CleanupAvatarVRHandController>().ToList(); ExecutionMode executionMode = (ExecutionMode)Enum.ToObject(typeof(ExecutionMode), CleanupConfig.Instance.configFileInfo.executionMode); switch (executionMode) { // For the competition. Read generated data. case ExecutionMode.Competition: { this.ovrCameraRig.SetActive(false); this.avatarAnimator.enabled = false; CleanupAvatarVRHandController[] cleanupAvatarVRHandControllers = this.GetComponentsInChildren <CleanupAvatarVRHandController>(); foreach (CleanupAvatarVRHandController cleanupAvatarVRHandController in cleanupAvatarVRHandControllers) { cleanupAvatarVRHandController.enabled = false; } this.rootCapsuleCollider.enabled = false; foreach (CapsuleCollider capsuleCollider in this.capsuleColliders) { capsuleCollider.enabled = true; } this.simpleHumanVRController.enabled = false; this.simpleIK.enabled = false; foreach (CleanupAvatarVRHandController cleanupAvatarVRHandController in this.cleanupAvatarVRHandControllers) { cleanupAvatarVRHandController.enabled = false; } this.initialPositionMarker.SetActive(false); this.enabled = false; break; } // For data generation. case ExecutionMode.DataGeneration: { this.ovrCameraRig.SetActive(true); this.avatarAnimator.enabled = true; this.rootCapsuleCollider.enabled = true; foreach (CapsuleCollider capsuleCollider in this.capsuleColliders) { capsuleCollider.enabled = false; } this.simpleHumanVRController.enabled = true; this.simpleIK.enabled = true; foreach (CleanupAvatarVRHandController cleanupAvatarVRHandController in this.cleanupAvatarVRHandControllers) { cleanupAvatarVRHandController.enabled = true; } this.initialPositionMarker.SetActive(true); break; } default: { throw new Exception("Illegal Execution mode. mode=" + CleanupConfig.Instance.configFileInfo.executionMode); } } }
void Awake() { this.capsuleColliders = this.GetComponentsInChildren <CapsuleCollider>().ToList(); this.capsuleColliders.Remove(this.rootCapsuleCollider); this.simpleHumanVRController = this.GetComponentInChildren <SimpleHumanVRController>(); this.simpleIK = this.GetComponentInChildren <SimpleIK>(); this.cleanupAvatarVRHandControllers = this.GetComponentsInChildren <CleanupAvatarVRHandController>().ToList(); ExecutionMode executionMode = (ExecutionMode)Enum.ToObject(typeof(ExecutionMode), CleanupConfig.Instance.configFileInfo.executionMode); switch (executionMode) { // For the competition. Read generated data. case ExecutionMode.Competition: { this.cameraRig.SetActive(false); this.avatarAnimator.enabled = false; this.rootCapsuleCollider.enabled = false; foreach (CapsuleCollider capsuleCollider in this.capsuleColliders) { capsuleCollider.enabled = true; } this.simpleHumanVRController.enabled = false; this.simpleIK.enabled = false; foreach (CleanupAvatarVRHandController cleanupAvatarVRHandController in this.cleanupAvatarVRHandControllers) { cleanupAvatarVRHandController.enabled = false; } this.initialPositionMarker.SetActive(false); // Add for SteamVR START Rigidbody[] rigidbodies = this.GetComponentsInChildren <Rigidbody>(true); foreach (Rigidbody rigidbody in rigidbodies) { rigidbody.useGravity = false; } // Add for SteamVR END this.enabled = false; break; } // For data generation. case ExecutionMode.DataGeneration: { StartCoroutine(this.InitializeHumanForDataGeneration()); break; } default: { throw new Exception("Illegal Execution mode. mode=" + CleanupConfig.Instance.configFileInfo.executionMode); } } }