2019-07-29 16:29:21 +02:00
|
|
|
|
///-----------------------------------------------------------------
|
|
|
|
|
/// 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;
|
2019-04-10 13:39:36 +02:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
2019-07-29 16:29:21 +02:00
|
|
|
|
namespace Cozmo
|
2019-04-10 13:39:36 +02:00
|
|
|
|
{
|
2019-07-29 16:29:21 +02:00
|
|
|
|
public class CozmoAcademy : Academy
|
2019-05-17 19:12:07 +02:00
|
|
|
|
{
|
2019-07-29 16:29:21 +02:00
|
|
|
|
[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;
|
|
|
|
|
|
2019-05-17 19:12:07 +02:00
|
|
|
|
|
2019-07-29 16:29:21 +02:00
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
2019-04-10 13:39:36 +02:00
|
|
|
|
}
|