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.
 
 
 
 

60 lines
1.0 KiB

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//This is a very simple animation controller that does nothing.
//We will use it when we generate a physics ragdoll from an animated character
//that has no specific animationController (i.e., a component that implements the IAnimaitonController interface)
public class DefaultAnimationController : MonoBehaviour, IAnimationController
{
[SerializeField]
Animator _anim;
public void OnEnable()
{
OnAgentInitialize();
}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void OnAgentInitialize() {
if (!_anim)
_anim = GetComponent<Animator>();
}
public void OnReset() {
}
public Vector3 GetDesiredVelocity() {
//TODO: check if this is really what we want, we may need the root velocity
return _anim.angularVelocity;
}
}