|
123456789101112131415161718192021222324252627282930313233343536 |
- ///-----------------------------------------------------------------
- /// Namespace: <Cozmo>
- /// Class: <CozmoAcademy>
- /// Description: <The academy used for cozmo. Sets cozmo back to its starting position if the academy gets reset.>
- /// Author: <Tobias Hassel> Date: <29.07.2019>
- /// Notes: <>
- ///-----------------------------------------------------------------
- ///
-
- using MLAgents;
- using UnityEngine;
-
- namespace Cozmo
- {
- public class CozmoAcademy : Academy
- {
- [Tooltip("Reference to the cozmo gameobject in the scene.")]
- public GameObject cozmo;
- [Tooltip("Reference to the transform which represents the starting position for cozmo.")]
- public Transform startPoint;
-
-
- public override void AcademyReset()
- {
- SetCozmoBackToStartingPosition();
- }
-
- // Resets Cozmos position and rotation to match its starting position
- private void SetCozmoBackToStartingPosition()
- {
- cozmo.transform.position = startPoint.position;
- cozmo.transform.rotation = startPoint.rotation;
- }
-
- }
- }
|