user input del & pose camera fixed
This commit is contained in:
@@ -27,6 +27,7 @@ public class InputController : MonoBehaviour
|
|||||||
public Vector3 HorizontalDirection; // Normalized vector in direction of travel (assume right angle to floor)
|
public Vector3 HorizontalDirection; // Normalized vector in direction of travel (assume right angle to floor)
|
||||||
public bool UseHumanInput = true;
|
public bool UseHumanInput = true;
|
||||||
public bool DemoMockIfNoInput = true; // Demo mock mode if no human input
|
public bool DemoMockIfNoInput = true; // Demo mock mode if no human input
|
||||||
|
public bool m_IsTraining = false;
|
||||||
|
|
||||||
float _delayUntilNextAction;
|
float _delayUntilNextAction;
|
||||||
float _timeUnillDemo;
|
float _timeUnillDemo;
|
||||||
@@ -39,7 +40,8 @@ public class InputController : MonoBehaviour
|
|||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
UseHumanInput = !Academy.Instance.IsCommunicatorOn;
|
if(m_IsTraining)
|
||||||
|
UseHumanInput = !Academy.Instance.IsCommunicatorOn;
|
||||||
_timeUnillDemo = 1f;
|
_timeUnillDemo = 1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,7 +171,7 @@ public class InputController : MonoBehaviour
|
|||||||
// keep power above deadzone as we handle that below
|
// keep power above deadzone as we handle that below
|
||||||
power = kDeadzone + (power * (1f-kDeadzone));
|
power = kDeadzone + (power * (1f-kDeadzone));
|
||||||
// 2 in 5 times we are going to stand still
|
// 2 in 5 times we are going to stand still
|
||||||
if (UnityEngine.Random.value < .4f)
|
if (UnityEngine.Random.value < .5f)
|
||||||
power = 0.001f;
|
power = 0.001f;
|
||||||
// float direction = UnityEngine.Random.Range(-Mathf.PI/8, Mathf.PI/8);
|
// float direction = UnityEngine.Random.Range(-Mathf.PI/8, Mathf.PI/8);
|
||||||
// float power = UnityEngine.Random.Range(1f, 1f);
|
// float power = UnityEngine.Random.Range(1f, 1f);
|
||||||
|
|||||||
2761
Assets/5_Scenes/DreconDemo.unity
generated
2761
Assets/5_Scenes/DreconDemo.unity
generated
File diff suppressed because it is too large
Load Diff
47
Assets/8_Scripts/2_General/FindTargetAnimationRagdool.cs
Normal file
47
Assets/8_Scripts/2_General/FindTargetAnimationRagdool.cs
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Cinemachine;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.Pool;
|
||||||
|
|
||||||
|
public class FindTargetAnimationRagdool : MonoBehaviour
|
||||||
|
{
|
||||||
|
private Transform m_LookAt;
|
||||||
|
private Transform m_Follow;
|
||||||
|
private CinemachineVirtualCamera m_VirtualCamera;
|
||||||
|
private bool m_Search = false;
|
||||||
|
private GameObject m_Ragdoll;
|
||||||
|
|
||||||
|
private void Start(){
|
||||||
|
m_VirtualCamera = this.GetComponent<CinemachineVirtualCamera>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Update(){
|
||||||
|
if(!m_Search){
|
||||||
|
try{
|
||||||
|
|
||||||
|
m_Ragdoll = GameObject.Find("RagdollForMocap");
|
||||||
|
|
||||||
|
if(m_Ragdoll != null){
|
||||||
|
m_Search = true;
|
||||||
|
SetupVirtualCameraSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch {
|
||||||
|
Debug.Log("Ragdoll Animator not found.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetupVirtualCameraSettings(){
|
||||||
|
//Do something
|
||||||
|
Debug.Log("Found.");
|
||||||
|
m_LookAt = m_Ragdoll.transform.Find("articulation:Hips");
|
||||||
|
m_Follow = m_Ragdoll.transform.Find("articulation:Hips");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
m_VirtualCamera.LookAt = m_LookAt;
|
||||||
|
m_VirtualCamera.Follow = m_Follow;
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/8_Scripts/2_General/FindTargetAnimationRagdool.cs.meta
generated
Normal file
11
Assets/8_Scripts/2_General/FindTargetAnimationRagdool.cs.meta
generated
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 79a62bbe0c1d09648811dfd58e63b974
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
2548
Assets/9_Models/Humanoid/SMPLX Blend/SMPLX Target.prefab
generated
Normal file
2548
Assets/9_Models/Humanoid/SMPLX Blend/SMPLX Target.prefab
generated
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/9_Models/Humanoid/SMPLX Blend/SMPLX Target.prefab.meta
generated
Normal file
7
Assets/9_Models/Humanoid/SMPLX Blend/SMPLX Target.prefab.meta
generated
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8e4461c8c94b7a149aae1a5b7a9f1945
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -1 +1 @@
|
|||||||
{"count":1,"self":119.86694399999999,"total":124.50362799999999,"children":{"InitializeActuators":{"count":1,"self":0.0020386,"total":0.0020386,"children":null},"InitializeSensors":{"count":1,"self":0.0009555,"total":0.0009555,"children":null},"AgentSendState":{"count":7072,"self":0.061914,"total":1.0812046,"children":{"CollectObservations":{"count":3536,"self":0.9843132,"total":0.9843132,"children":null},"WriteActionMask":{"count":3536,"self":0.0049786,"total":0.0049786,"children":null},"RequestDecision":{"count":3536,"self":0.0299988,"total":0.0299988,"children":null}}},"DecideAction":{"count":7072,"self":2.5077692,"total":2.5077691,"children":null},"AgentAct":{"count":7072,"self":1.0434105,"total":1.0434105,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714478128","unity_version":"2022.3.5f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2022.3.5f1\\Editor\\Unity.exe -projectpath C:\\Users\\caile\\Desktop\\drecon-unity -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-cail -hubSessionId 60ab91bb-e88b-415d-bad5-85669cb2f254 -accessToken igrlSuBmRMV_tJv_LBLFXMbOAtqeySRX9_MYTnwkljU005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"DreconDemo","end_time_seconds":"1714478252"}}
|
{"count":1,"self":68.620896,"total":71.1414624,"children":{"InitializeActuators":{"count":1,"self":0.0009998,"total":0.0009998,"children":null},"InitializeSensors":{"count":1,"self":0.0020001,"total":0.0020001,"children":null},"AgentSendState":{"count":3851,"self":0.0296706,"total":0.5101487,"children":{"CollectObservations":{"count":1926,"self":0.4604354,"total":0.4604354,"children":null},"WriteActionMask":{"count":1926,"self":0.0026497,"total":0.0026497,"children":null},"RequestDecision":{"count":1926,"self":0.017393,"total":0.017393,"children":null}}},"DecideAction":{"count":3851,"self":1.4214537999999999,"total":1.4214537999999999,"children":null},"AgentAct":{"count":3851,"self":0.58545589999999992,"total":0.58545589999999992,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714482096","unity_version":"2022.3.5f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2022.3.5f1\\Editor\\Unity.exe -projectpath C:\\Users\\caile\\Desktop\\drecon-unity -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-cail -hubSessionId 60ab91bb-e88b-415d-bad5-85669cb2f254 -accessToken igrlSuBmRMV_tJv_LBLFXMbOAtqeySRX9_MYTnwkljU005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"DreconDemo","end_time_seconds":"1714482167"}}
|
||||||
2
ProjectSettings/DynamicsManager.asset
generated
2
ProjectSettings/DynamicsManager.asset
generated
@@ -18,7 +18,7 @@ PhysicsManager:
|
|||||||
m_ClothInterCollisionDistance: 0.1
|
m_ClothInterCollisionDistance: 0.1
|
||||||
m_ClothInterCollisionStiffness: 0.2
|
m_ClothInterCollisionStiffness: 0.2
|
||||||
m_ContactsGeneration: 1
|
m_ContactsGeneration: 1
|
||||||
m_LayerCollisionMatrix: ffffffffffffffffffffffffb7fefffffffffffffffffffff7fcfffffffdffffb7ffffff3fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
m_LayerCollisionMatrix: ffffffffffffffffffffffffb7befffffffffffffffffffff7bcffffffbdffffb7bfffff3fbfffffffffffffffffffffffbfffffffffffff37ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||||
m_SimulationMode: 0
|
m_SimulationMode: 0
|
||||||
m_AutoSyncTransforms: 1
|
m_AutoSyncTransforms: 1
|
||||||
m_ReuseCollisionCallbacks: 0
|
m_ReuseCollisionCallbacks: 0
|
||||||
|
|||||||
Reference in New Issue
Block a user