implementation of drecon in unity 2022 lts
forked from:
https://github.com/joanllobera/marathon-envs
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
712 B
30 lines
712 B
6 months ago
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using Unity.MLAgents.Policies;
|
||
|
using UnityEngine;
|
||
|
|
||
|
public class ModelManager : MonoBehaviour
|
||
|
{
|
||
|
[SerializeField]
|
||
|
public string m_ModelName;
|
||
|
|
||
|
private BehaviorParameters m_Parameters;
|
||
|
|
||
|
// Unity Events //
|
||
|
public delegate void onUpdateModelNameDelegate(string modelName);
|
||
|
public static onUpdateModelNameDelegate m_UpdateModelName;
|
||
|
private void OnEnable()
|
||
|
{
|
||
|
m_Parameters = GetComponent<BehaviorParameters>();
|
||
|
}
|
||
|
|
||
|
private void FixedUpdate()
|
||
|
{
|
||
|
if (m_Parameters != null)
|
||
|
{
|
||
|
m_ModelName = m_Parameters.Model.name;
|
||
|
m_UpdateModelName?.Invoke(m_ModelName);
|
||
|
}
|
||
|
}
|
||
|
}
|