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
894 B
30 lines
894 B
9 months ago
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
|
||
|
|
||
|
//a class used to find out the offsets that we need to apply to the method Remap2Character, to go from a Physics-based character to a kinematic one
|
||
|
//make sure you use the axis in local mode to find out rapidly the offset needed
|
||
|
public class DebugAddOffset : MonoBehaviour
|
||
|
{
|
||
|
/* [SerializeField]
|
||
|
Vector3 axis;
|
||
|
[SerializeField]
|
||
|
float angleDegrees;
|
||
|
*/
|
||
|
|
||
|
[SerializeField]
|
||
|
Vector3 eulerAngles;
|
||
|
|
||
|
[SerializeField]
|
||
|
bool applyOffset = false;
|
||
|
|
||
|
// Update is called once per frame
|
||
|
void LateUpdate()
|
||
|
{
|
||
|
if (applyOffset)
|
||
|
// transform.localRotation = transform.localRotation * Quaternion.AngleAxis(angleDegrees, axis);
|
||
|
transform.localRotation = Quaternion.Euler(eulerAngles.x, eulerAngles.y, eulerAngles.z) * transform.localRotation;
|
||
|
}
|
||
|
}
|