Commit 7190f3bd authored by ATREVI Dieudonne's avatar ATREVI Dieudonne
Browse files

- Fix bug related to replay scenario

- Fix control canvas size
- Fix followOnX and followOnY behavior
parent 4540e844
......@@ -757,7 +757,7 @@ RectTransform:
m_GameObject: {fileID: 52447637}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalScale: {x: 2, y: 2, z: 1}
m_Children:
- {fileID: 612627131}
m_Father: {fileID: 1154231147}
......@@ -766,7 +766,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 69.754, y: 27.3}
m_SizeDelta: {x: 50, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &52447639
MonoBehaviour:
......@@ -6341,12 +6341,12 @@ MonoBehaviour:
m_OnValueChanged:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 0}
m_MethodName:
- m_Target: {fileID: 1898254886}
m_MethodName: checkLookatToggle
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName:
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
......@@ -6809,7 +6809,7 @@ RectTransform:
m_GameObject: {fileID: 525111704}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalScale: {x: 2, y: 2, z: 1}
m_Children:
- {fileID: 1508612220}
m_Father: {fileID: 1154231147}
......@@ -6818,7 +6818,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 57.997, y: 27.3}
m_SizeDelta: {x: 45, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &525111706
MonoBehaviour:
......@@ -10802,7 +10802,7 @@ RectTransform:
m_GameObject: {fileID: 943443529}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 39}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalScale: {x: 2.7878, y: 1.6721714, z: 2.7157557}
m_Children:
- {fileID: 840018334}
- {fileID: 613463099}
......@@ -10810,10 +10810,10 @@ RectTransform:
m_Father: {fileID: 1229005602}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: -153}
m_SizeDelta: {x: 239.6, y: 48.65}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: 0, y: 88}
m_SizeDelta: {x: 239.6, y: 48.649994}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &943443531
MonoBehaviour:
......@@ -12741,10 +12741,10 @@ RectTransform:
m_Father: {fileID: 1630200776}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -396, y: -1.7284851}
m_SizeDelta: {x: -792.1, y: -3.457}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 289.2, y: -41.855}
m_SizeDelta: {x: 560.1, y: 64.898}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1154231148
MonoBehaviour:
......@@ -12769,8 +12769,8 @@ MonoBehaviour:
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 0
m_ChildControlHeight: 0
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_ChildScaleWidth: 1
m_ChildScaleHeight: 1
--- !u!114 &1154231149
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -12784,7 +12784,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0.65882355}
m_Color: {r: 1, g: 1, b: 1, a: 0}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
......@@ -12835,18 +12835,18 @@ RectTransform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1179796687}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalPosition: {x: 0, y: 0, z: -4}
m_LocalScale: {x: 2.0124, y: 1.7044, z: 2.190258}
m_Children:
- {fileID: 1741090612}
- {fileID: 1970815489}
m_Father: {fileID: 1229005602}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: -182.2}
m_SizeDelta: {x: 105, y: 35.6}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: -0, y: 37}
m_SizeDelta: {x: 105, y: 35.600006}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1179796689
MonoBehaviour:
......@@ -13036,8 +13036,8 @@ RectTransform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1190148012}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalPosition: {x: 0, y: 0, z: 1}
m_LocalScale: {x: 2, y: 2, z: 1}
m_Children:
- {fileID: 873226972}
m_Father: {fileID: 1154231147}
......@@ -13046,7 +13046,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 69.754, y: 27.3}
m_SizeDelta: {x: 50, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1190148014
MonoBehaviour:
......@@ -13754,10 +13754,10 @@ MonoBehaviour:
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 400}
m_ReferenceResolution: {x: 1366, y: 768}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 1
m_PhysicalUnit: 3
m_MatchWidthOrHeight: 0.501
m_PhysicalUnit: 2
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
......@@ -14477,7 +14477,7 @@ RectTransform:
m_GameObject: {fileID: 1254477450}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalScale: {x: 2, y: 2, z: 1}
m_Children:
- {fileID: 1099562921}
m_Father: {fileID: 1154231147}
......@@ -14486,7 +14486,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 50.6, y: 27.3}
m_SizeDelta: {x: 50, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1254477452
MonoBehaviour:
......@@ -17867,7 +17867,6 @@ GameObject:
m_Component:
- component: {fileID: 1538513869}
- component: {fileID: 1538513871}
- component: {fileID: 1538513870}
m_Layer: 5
m_Name: Followat
m_TagString: Untagged
......@@ -17896,34 +17895,6 @@ RectTransform:
m_AnchoredPosition: {x: 103.2, y: -80.5}
m_SizeDelta: {x: 28.300003, y: 15.989998}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1538513870
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1538513868}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0b148fe25e99eb48b9724523833bab1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Delegates:
- eventID: 4
callback:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1898254886}
m_MethodName: checkLookatToggleOnScene
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &1538513871
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -18323,7 +18294,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -16.368}
m_AnchoredPosition: {x: 0, y: -16.368042}
m_SizeDelta: {x: 0, y: -32.736}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1555170343
......@@ -19381,10 +19352,10 @@ RectTransform:
m_Father: {fileID: 1229005602}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -16.269043, y: 183.63}
m_SizeDelta: {x: -32.538, y: -367.26}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 632.7, y: -37}
m_SizeDelta: {x: 1265.5, y: 74}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1630200777
MonoBehaviour:
......@@ -22726,7 +22697,7 @@ RectTransform:
m_GameObject: {fileID: 1924304614}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.82691747, y: 0.82691747, z: 0.82691747}
m_LocalScale: {x: 2.0856369, y: 1.6099732, z: 1.2717164}
m_Children:
- {fileID: 691017054}
m_Father: {fileID: 1229005602}
......@@ -22734,8 +22705,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -16.53833, y: -16.73642}
m_SizeDelta: {x: 32, y: 32}
m_AnchoredPosition: {x: -37.7, y: -32.8}
m_SizeDelta: {x: 22.1, y: 25.5}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1924304616
MonoBehaviour:
......@@ -25532,7 +25503,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.6792453, g: 0.6311855, b: 0.6311855, a: 1}
m_Color: {r: 0.24705882, g: 0.05882353, b: 0.05882353, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
......
......@@ -381,6 +381,9 @@ public class FollowTrajectory : MonoBehaviour
if(LoadEnv.cmptDone == LoadEnv.nbAgent)
{
MenuManager.replayButton.SetActive(true);
GameObject[] list = GameObject.FindGameObjectsWithTag("Player");
foreach(GameObject a in list)
Destroy(a);
}
return;
}
......
......@@ -60,6 +60,7 @@ public class LoadEnv : MonoBehaviour
/// </summary>
void Start()
{
Debug.Log("Load Env");
avatars = new List<GameObject>();
cam_Rec = cam.GetComponent<CamRecorder>();
cam_Movement = cam.GetComponent<CamMvt>();
......
......@@ -117,8 +117,7 @@ public class MenuManager : MonoBehaviour
}
progressBar.value = t;
}
}
/// <summary>
......@@ -305,25 +304,24 @@ public class MenuManager : MonoBehaviour
GameObject PanelMovCamera = GameObject.Find("/controlCanvas/cameraMovPanel");
GameObject LookAgentIDtxt = GameObject.Find("/controlCanvas/cameraMovPanel/LookAgentIDtxt");
GameObject LookAgentID = GameObject.Find("/controlCanvas/cameraMovPanel/LookAgentID");
LookAgentIDtxt.SetActive(PanelMovCamera.transform.Find("Lookat").GetComponent<Toggle>().isOn);
LookAgentID.SetActive(PanelMovCamera.transform.Find("Lookat").GetComponent<Toggle>().isOn);
GameObject FollowAgentIDtxt = GameObject.Find("/controlCanvas/cameraMovPanel/FollowAgentIDtxt");
GameObject FollowAgentID = GameObject.Find("/controlCanvas/cameraMovPanel/FollowAgentID");
FollowAgentIDtxt.SetActive(PanelMovCamera.transform.Find("Followat").GetComponent<Toggle>().isOn);
FollowAgentID.SetActive(PanelMovCamera.transform.Find("Followat").GetComponent<Toggle>().isOn);
if(!PanelMovCamera.transform.Find("Followat").GetComponent<Toggle>().isOn){
PanelMovCamera.transform.Find("FollowX").GetComponent<Toggle>().interactable = false;
PanelMovCamera.transform.Find("FollowY").GetComponent<Toggle>().interactable = false;
PanelMovCamera.transform.Find("LockPerson").GetComponent<Toggle>().interactable = false;
}
else{
PanelMovCamera.transform.Find("FollowX").GetComponent<Toggle>().interactable = true;
PanelMovCamera.transform.Find("FollowY").GetComponent<Toggle>().interactable = true;
PanelMovCamera.transform.Find("LockPerson").GetComponent<Toggle>().interactable = true;
}
bool activateLookAt = PanelMovCamera.transform.Find("Lookat").GetComponent<Toggle>().isOn;
bool activateFollow = PanelMovCamera.transform.Find("Followat").GetComponent<Toggle>().isOn;
LookAgentIDtxt.SetActive(activateLookAt);
LookAgentID.SetActive(activateLookAt);
FollowAgentIDtxt.SetActive(activateFollow);
FollowAgentID.SetActive(activateFollow);
PanelMovCamera.transform.Find("FollowX").GetComponent<Toggle>().interactable = activateFollow;
PanelMovCamera.transform.Find("FollowY").GetComponent<Toggle>().interactable = activateFollow;
Dropdown camSelect = PanelMovCamera.transform.Find("cameraType").GetComponent<Dropdown>();
bool showLockFirstPerson = camSelect.options[camSelect.value].text == "First_Person" || camSelect.options[camSelect.value].text == "Torsum";
PanelMovCamera.transform.Find("LockPerson").GetComponent<Toggle>().interactable = showLockFirstPerson&&activateFollow;
}
/// <summary>
......@@ -339,7 +337,11 @@ public class MenuManager : MonoBehaviour
cameraMovPanel.SetActive(!panel.activeSelf);
slider.SetActive(!panel.activeSelf);
replayButton.SetActive(!panel.activeSelf);
// Pause the scenario while showing the menu
GameObject[] list = GameObject.FindGameObjectsWithTag("Player");
foreach(GameObject a in list)
Destroy(a);
Time.timeScale = 0;
}
......@@ -421,8 +423,6 @@ public class MenuManager : MonoBehaviour
/// </summary>
public void replayScenario()
{
GameObject[] list = GameObject.FindGameObjectsWithTag("Player");
Debug.Log(list.Length);
startScenario();
replayButton.SetActive(false);
Pause();
......
......@@ -19,6 +19,7 @@
**
** Contact: crowd_group@inria.fr
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
......@@ -97,7 +98,7 @@ public class CamMvt : MonoBehaviour
public void update_look_at_target()
{
GameObject[] list = GameObject.FindGameObjectsWithTag("Player");
//Debug.Log(list.Length);
if (activateLookAt && lookAt_Id >= 0 && list.Length > 0)
{
if (lookAt_Id > list.Length - 1)
......@@ -117,7 +118,7 @@ public class CamMvt : MonoBehaviour
public void update_follow_target()
{
GameObject[] list = GameObject.FindGameObjectsWithTag("Player");
//Debug.Log(list.Length);
if (activateFollow && follow_Id >= 0 && list.Length > 0)
{
if (follow_Id > list.Length - 1)
......@@ -154,6 +155,7 @@ public class CamMvt : MonoBehaviour
// ----------------------------
// UPDATE VALUES
// update follow id
readCameraMovParamOnScene();
if (follow_Id != _previous_follow_Id && activateFollow)
......@@ -171,43 +173,46 @@ public class CamMvt : MonoBehaviour
// ------------------------------
// ROTATION - LOOKING AT AN AGENT
if (lockFirstPersonView)
{
if (camSelect.options[camSelect.value].text == "First_Person")
{
transform.forward = agent_reference_transform.forward;
}
else if (camSelect.options[camSelect.value].text == "Torsum")
{
transform.forward = agent_reference_transform.forward;
}
}
if(camSelect.options[camSelect.value].text == "Default")
{
transform.eulerAngles = _default_rotation;
}
else if (lookAt_Agent != null && activateLookAt)
{
transform.LookAt(lookAt_Agent.transform);
if (lockFirstPersonView)
{
if (camSelect.options[camSelect.value].text == "First_Person")
{
transform.forward = agent_reference_transform.forward;
}
else if (camSelect.options[camSelect.value].text == "Torsum")
{
transform.forward = agent_reference_transform.forward;
}
}
else if(camSelect.options[camSelect.value].text != "Free_Movement")
transform.LookAt(lookAt_Agent.transform);
}
#endregion
#region TRANSLATION
if (follow_Agent != null)
if (camSelect.options[camSelect.value].text == "Default")
{
transform.position = _default_position;
}
if (follow_Agent != null && activateFollow)
{
Vector3 delta = follow_Agent.transform.position - follow_LastPosition;
follow_LastPosition = follow_Agent.transform.position;
if (!followOnX){
delta.x = 0;
}
if (!followOnY){
delta.z = 0;
}
if(followOnX && followOnY){
delta.x = 0;
delta.z = 0;
}
_position_follow = _position_follow + delta;
_position_first_person = agent_head_transform.position;
......@@ -216,10 +221,7 @@ public class CamMvt : MonoBehaviour
// --------------------------------
// TRANSLATION - FOLLOWING AN AGENT
if (camSelect.options[camSelect.value].text == "Default")
{
transform.position = _default_position;
}
if (camSelect.options[camSelect.value].text == "Follow")
{
transform.position = _position_follow;
......
......@@ -307,52 +307,27 @@ public class ConfigManager : MonoBehaviour
/// Method to check if the lookAt and FollowAt toggle are on or off and display the suitable parameters accordingly.
/// </summary>
public void checkLookatToggle(){
PanelCamera = GameObject.Find("/ConfigMenu/Panel/PanelCamera/Button/Panel");
GameObject LookAgentIDtxt = GameObject.Find("/ConfigMenu/Panel/PanelCamera/Button/Panel/LookAgentIDtxt");
GameObject LookAgentID = GameObject.Find("/ConfigMenu/Panel/PanelCamera/Button/Panel/LookAgentID");
LookAgentIDtxt.SetActive(PanelCamera.transform.Find("Lookat").GetComponent<Toggle>().isOn);
LookAgentID.SetActive(PanelCamera.transform.Find("Lookat").GetComponent<Toggle>().isOn);
PanelCamera = GameObject.Find("/ConfigMenu/Panel/PanelCamera/Button/Panel");
GameObject LookAgentIDtxt = GameObject.Find("/ConfigMenu/Panel/PanelCamera/Button/Panel/LookAgentIDtxt");
GameObject LookAgentID = GameObject.Find("/ConfigMenu/Panel/PanelCamera/Button/Panel/LookAgentID");
GameObject FollowAgentIDtxt = GameObject.Find("/ConfigMenu/Panel/PanelCamera/Button/Panel/FollowAgentIDtxt");
GameObject FollowAgentID = GameObject.Find("/ConfigMenu/Panel/PanelCamera/Button/Panel/FollowAgentID");
FollowAgentIDtxt.SetActive(PanelCamera.transform.Find("Followat").GetComponent<Toggle>().isOn);
FollowAgentID.SetActive(PanelCamera.transform.Find("Followat").GetComponent<Toggle>().isOn);
if(!PanelCamera.transform.Find("Followat").GetComponent<Toggle>().isOn){
PanelCamera.transform.Find("FollowX").GetComponent<Toggle>().interactable = false;
PanelCamera.transform.Find("FollowY").GetComponent<Toggle>().interactable = false;
PanelCamera.transform.Find("LockPerson").GetComponent<Toggle>().interactable = false;
}
else{
PanelCamera.transform.Find("FollowX").GetComponent<Toggle>().interactable = true;
PanelCamera.transform.Find("FollowY").GetComponent<Toggle>().interactable = true;
PanelCamera.transform.Find("LockPerson").GetComponent<Toggle>().interactable = true;
}
}
bool activateLookAt = PanelCamera.transform.Find("Lookat").GetComponent<Toggle>().isOn;
bool activateFollow = PanelCamera.transform.Find("Followat").GetComponent<Toggle>().isOn;
public void checkLookatToggleOnScene(){
GameObject PanelMovCamera = GameObject.Find("/controlCanvas/cameraMovPanel");
GameObject LookAgentIDtxt = GameObject.Find("/controlCanvas/cameraMovPanel/LookAgentIDtxt");
GameObject LookAgentID = GameObject.Find("/controlCanvas/cameraMovPanel/LookAgentID");
LookAgentIDtxt.SetActive(activateLookAt);
LookAgentID.SetActive(activateLookAt);
FollowAgentIDtxt.SetActive(activateFollow);
FollowAgentID.SetActive(activateFollow);
LookAgentIDtxt.SetActive(PanelMovCamera.transform.Find("Lookat").GetComponent<Toggle>().isOn);
LookAgentID.SetActive(PanelMovCamera.transform.Find("Lookat").GetComponent<Toggle>().isOn);
GameObject FollowAgentIDtxt = GameObject.Find("/controlCanvas/cameraMovPanel/FollowAgentIDtxt");
GameObject FollowAgentID = GameObject.Find("/controlCanvas/cameraMovPanel/FollowAgentID");
PanelCamera.transform.Find("FollowX").GetComponent<Toggle>().interactable = activateFollow;
PanelCamera.transform.Find("FollowY").GetComponent<Toggle>().interactable = activateFollow;
FollowAgentIDtxt.SetActive(PanelMovCamera.transform.Find("Followat").GetComponent<Toggle>().isOn);
FollowAgentID.SetActive(PanelMovCamera.transform.Find("Followat").GetComponent<Toggle>().isOn);
if(!PanelMovCamera.transform.Find("Followat").GetComponent<Toggle>().isOn){
PanelMovCamera.transform.Find("FollowX").GetComponent<Toggle>().interactable = false;
PanelMovCamera.transform.Find("FollowY").GetComponent<Toggle>().interactable = false;
PanelMovCamera.transform.Find("LockPerson").GetComponent<Toggle>().interactable = false;
}
else{
PanelMovCamera.transform.Find("FollowX").GetComponent<Toggle>().interactable = true;
PanelMovCamera.transform.Find("FollowY").GetComponent<Toggle>().interactable = true;
PanelMovCamera.transform.Find("LockPerson").GetComponent<Toggle>().interactable = true;
}
Dropdown camSelect = PanelCamera.transform.Find("cameraType").GetComponent<Dropdown>();
bool showLockFirstPerson = camSelect.options[camSelect.value].text == "First_Person" || camSelect.options[camSelect.value].text == "Torsum";
PanelCamera.transform.Find("LockPerson").GetComponent<Toggle>().interactable = showLockFirstPerson&&activateFollow;
}
}
\ No newline at end of file
......@@ -27,4 +27,4 @@
<saveDir>./Output/Follow/</saveDir>
</recording>
<AgentColorList />
</ConfigData>
</ConfigData>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment