Readd mlagents 0.8.1
This commit is contained in:
@@ -24,7 +24,7 @@ public class CozmoMovement : MonoBehaviour
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
// When the tank is turned on, make sure it's not kinematic.
|
||||
// When the cozmo is turned on, make sure it's not kinematic.
|
||||
m_Rigidbody.isKinematic = false;
|
||||
|
||||
// Also reset the input values.
|
||||
@@ -35,17 +35,15 @@ public class CozmoMovement : MonoBehaviour
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
// When the tank is turned off, set it to kinematic so it stops moving.
|
||||
// When the cozmo is turned off, set it to kinematic so it stops moving.
|
||||
m_Rigidbody.isKinematic = true;
|
||||
}
|
||||
|
||||
|
||||
private void Start()
|
||||
{
|
||||
// The axes names are based on player number.
|
||||
m_MovementAxisName = "Vertical";
|
||||
m_TurnAxisName = "Horizontal";
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +64,7 @@ public class CozmoMovement : MonoBehaviour
|
||||
|
||||
public void Move(float directionValue)
|
||||
{
|
||||
// Create a vector in the direction the tank is facing with a magnitude based on the input, speed and the time between frames.
|
||||
// Create a vector in the direction the cozmo is facing with a magnitude based on the input, speed and the time between frames.
|
||||
Vector3 movement = directionValue * transform.forward * m_Speed * Time.deltaTime;
|
||||
|
||||
// Apply this movement to the rigidbody's position.
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using UnityEngine;
|
||||
|
||||
public enum TestStates { MovementSpeed, RotationSpeed }
|
||||
public enum TestStates { MovementSpeed, RotationSpeed } // enum to determine test scenarios
|
||||
|
||||
[RequireComponent(typeof(CozmoMovement))]
|
||||
public class CozmoMovementTester : MonoBehaviour
|
||||
@@ -16,7 +16,6 @@ public class CozmoMovementTester : MonoBehaviour
|
||||
private CozmoMovement movement; // Reference to the movement script of cozmo
|
||||
private Vector3 startPositionCozmo; // Original position of cozmo
|
||||
private float lastY; // Last Y of cozmo
|
||||
private float curAngleX = 0; // Current angle in the x axis of cozmo
|
||||
private Stopwatch movementWatch; // Stopwatch to measure the time for the movement usecase
|
||||
private Stopwatch rotationWatch; // Stopwatch to measure the time for the rotation usecase
|
||||
|
||||
@@ -31,7 +30,7 @@ public class CozmoMovementTester : MonoBehaviour
|
||||
|
||||
|
||||
startPositionCozmo = movement.transform.position; // Cache the starting position of Cozmo
|
||||
lastY = movement.transform.rotation.y; // Cache the rotation Vector of Cozmo
|
||||
lastY = movement.transform.rotation.y; // Cache the rotation Vector of Cozmo
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
@@ -58,7 +57,7 @@ public class CozmoMovementTester : MonoBehaviour
|
||||
{
|
||||
rotationWatch.Stop();
|
||||
UnityEngine.Debug.Log("Cozmo: " + gameObject.name +
|
||||
"/nElapsed time in milliseconds (Rotation): " + rotationWatch.ElapsedMilliseconds);
|
||||
"\nElapsed time in milliseconds (Rotation): " + rotationWatch.ElapsedMilliseconds);
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user