Commit 8204895b authored by ATREVI Dieudonne's avatar ATREVI Dieudonne
Browse files

- Update parameter's modification panel

parent 0cd57acd
This diff is collapsed.
......@@ -262,14 +262,13 @@ public class MenuManager : MonoBehaviour
if(camSelect.options[camSelect.value].text == "Look_At")
cameraMovPanel.transform.Find("AgentID").GetComponent<InputField>().text = ConfigReader.camLookAtTarget.ToString();
else if(camSelect.options[camSelect.value].text == "Follow")
else if(camSelect.options[camSelect.value].text == "Follow" || camSelect.options[camSelect.value].text == "First_Person" || camSelect.options[camSelect.value].text == "Torsum")
cameraMovPanel.transform.Find("AgentID").GetComponent<InputField>().text = ConfigReader.camFollowTarget.ToString();
else
cameraMovPanel.transform.Find("AgentID").GetComponent<InputField>().text = "0";
cameraMovPanel.transform.Find("FollowX").GetComponent<Toggle>().isOn = ConfigReader.camFollowOnX;
cameraMovPanel.transform.Find("FollowY").GetComponent<Toggle>().isOn = ConfigReader.camFollowOnY;
cameraMovPanel.transform.Find("LockPerson").GetComponent<Toggle>().isOn = ConfigReader.camLockFirstPerson;
//cameraMovPanel.transform.Find("SmoothView").GetComponent<Toggle>().isOn = ConfigReader.camSmoothView;
}
/// <summary>
/// Load the current scenario file and remove the menu
......
......@@ -47,7 +47,9 @@ public class ConfigManager : MonoBehaviour
/// Get Camera Config
//Type of Camera
PanelCamera = GameObject.Find("/ConfigMenu/Panel/PanelCamera/Button/Panel");
PanelCamera.transform.Find("cameraType").GetComponent<Dropdown>().value = ConfigReader.camType;
Dropdown camSelect = PanelCamera.transform.Find("cameraType").GetComponent<Dropdown>();
camSelect.value = ConfigReader.camType;
// Position
Vector3 camPos = ConfigReader.camPosition;
PanelCamera.transform.Find("PosX").GetComponent<InputField>().text = camPos.x.ToString();
......@@ -60,16 +62,17 @@ public class ConfigManager : MonoBehaviour
PanelCamera.transform.Find("RotY").GetComponent<InputField>().text = camRot.y.ToString();
PanelCamera.transform.Find("RotZ").GetComponent<InputField>().text = camRot.z.ToString();
// Look At Agent
PanelCamera.transform.Find("LookAgentID").GetComponent<InputField>().text = ConfigReader.camLookAtTarget.ToString();
PanelCamera.transform.Find("Lookat").GetComponent<Toggle>().isOn = ConfigReader.lookAtAgent;
// Agent ID
if(camSelect.options[camSelect.value].text == "Look_At")
PanelCamera.transform.Find("AgentID").GetComponent<InputField>().text = ConfigReader.camLookAtTarget.ToString();
else if(camSelect.options[camSelect.value].text == "Follow" || camSelect.options[camSelect.value].text == "First_Person" || camSelect.options[camSelect.value].text == "Torsum")
PanelCamera.transform.Find("AgentID").GetComponent<InputField>().text = ConfigReader.camFollowTarget.ToString();
// Follow Agent
PanelCamera.transform.Find("Followat").GetComponent<Toggle>().isOn = ConfigReader.followAgent;
PanelCamera.transform.Find("FollowAgentID").GetComponent<InputField>().text = ConfigReader.camFollowTarget.ToString();
PanelCamera.transform.Find("FollowX").GetComponent<Toggle>().isOn = ConfigReader.camFollowOnX;
PanelCamera.transform.Find("FollowY").GetComponent<Toggle>().isOn = ConfigReader.camFollowOnY;
PanelCamera.transform.Find("LockPerson").GetComponent<Toggle>().isOn = ConfigReader.camLockFirstPerson;
//PanelCamera.transform.Find("SmoothView").GetComponent<Toggle>().isOn = ConfigReader.camSmoothView;
/// Get Recording parameters
// Duration
......@@ -114,7 +117,8 @@ public class ConfigManager : MonoBehaviour
//// Set Camera Config
// Type of camera
PanelCamera = GameObject.Find("/ConfigMenu/Panel/PanelCamera/Button/Panel");
ConfigReader.camType = PanelCamera.transform.Find("cameraType").GetComponent<Dropdown>().value;
Dropdown camSelect = PanelCamera.transform.Find("cameraType").GetComponent<Dropdown>();
ConfigReader.camType = camSelect.value;
// Position
Vector3 camPos;
......@@ -133,25 +137,32 @@ public class ConfigManager : MonoBehaviour
ConfigReader.camRotation = camRot;
// Look At Agent
if(PanelCamera.transform.Find("Lookat").GetComponent<Toggle>().isOn)
if(camSelect.options[camSelect.value].text == "Look_At")
{
ConfigReader.camLookAtTarget = int.Parse(PanelCamera.transform.Find("LookAgentID").GetComponent<InputField>().text);
ConfigReader.camLookAtTarget = int.Parse(PanelCamera.transform.Find("AgentID").GetComponent<InputField>().text);
}
else{
ConfigReader.camLookAtTarget = -1;
}
// Follow Agent
if(PanelCamera.transform.Find("Followat").GetComponent<Toggle>().isOn){
ConfigReader.camFollowTarget = int.Parse(PanelCamera.transform.Find("FollowAgentID").GetComponent<InputField>().text);
if(camSelect.options[camSelect.value].text == "Follow"){
ConfigReader.camFollowTarget = int.Parse(PanelCamera.transform.Find("AgentID").GetComponent<InputField>().text);
ConfigReader.camFollowOnX = PanelCamera.transform.Find("FollowX").GetComponent<Toggle>().isOn;
ConfigReader.camFollowOnY = PanelCamera.transform.Find("FollowY").GetComponent<Toggle>().isOn;
ConfigReader.camLockFirstPerson = PanelCamera.transform.Find("LockPerson").GetComponent<Toggle>().isOn;
}
else{
ConfigReader.camFollowTarget = -1;
}
// First Person and Torsum
if(camSelect.options[camSelect.value].text == "First_Person" || camSelect.options[camSelect.value].text == "Torsum")
{
ConfigReader.camFollowTarget = int.Parse(PanelCamera.transform.Find("AgentID").GetComponent<InputField>().text);
ConfigReader.camLockFirstPerson = PanelCamera.transform.Find("LockPerson").GetComponent<Toggle>().isOn;
//ConfigReader.camSmoothView = PanelCamera.transform.Find("SmoothView").GetComponent<Toggle>().isOn;
}
//// Set Recording parameters
// Duration
PanelRecording = GameObject.Find("/ConfigMenu/Panel/PanelRecording/Button/Panel");
......@@ -306,27 +317,25 @@ 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");
GameObject FollowAgentIDtxt = GameObject.Find("/ConfigMenu/Panel/PanelCamera/Button/Panel/FollowAgentIDtxt");
GameObject FollowAgentID = GameObject.Find("/ConfigMenu/Panel/PanelCamera/Button/Panel/FollowAgentID");
PanelCamera = GameObject.Find("/ConfigMenu/Panel/PanelCamera/Button/Panel");
GameObject AgentID = GameObject.Find("/ConfigMenu/Panel/PanelCamera/Button/Panel/AgentID");
bool activateLookAt = PanelCamera.transform.Find("Lookat").GetComponent<Toggle>().isOn;
bool activateFollow = PanelCamera.transform.Find("Followat").GetComponent<Toggle>().isOn;
Dropdown camSelect = PanelCamera.transform.Find("cameraType").GetComponent<Dropdown>();
bool showLockFirstPerson = camSelect.options[camSelect.value].text == "First_Person" || camSelect.options[camSelect.value].text == "Torsum";
bool activateLookAt = camSelect.options[camSelect.value].text == "Look_At";
bool activateFollow = camSelect.options[camSelect.value].text == "Follow";
LookAgentIDtxt.SetActive(activateLookAt);
LookAgentID.SetActive(activateLookAt);
FollowAgentIDtxt.SetActive(activateFollow);
FollowAgentID.SetActive(activateFollow);
if(camSelect.options[camSelect.value].text == "Look_At")
PanelCamera.transform.Find("AgentID").GetComponent<InputField>().text = ConfigReader.camLookAtTarget.ToString();
else if(camSelect.options[camSelect.value].text == "Follow" || camSelect.options[camSelect.value].text == "First_Person" || camSelect.options[camSelect.value].text == "Torsum")
PanelCamera.transform.Find("AgentID").GetComponent<InputField>().text = ConfigReader.camFollowTarget.ToString();
PanelCamera.transform.Find("AgentID").GetComponent<InputField>().interactable = activateLookAt||activateFollow||showLockFirstPerson;
PanelCamera.transform.Find("FollowX").GetComponent<Toggle>().interactable = activateFollow;
PanelCamera.transform.Find("FollowY").GetComponent<Toggle>().interactable = activateFollow;
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;
PanelCamera.transform.Find("LockPerson").GetComponent<Toggle>().interactable = showLockFirstPerson;
PanelCamera.transform.Find("SmoothView").GetComponent<Toggle>().interactable = showLockFirstPerson;
}
}
\ No newline at end of file
......@@ -8,11 +8,11 @@
<rotation x="0" y="0" z="0" />
</env_stageInfos>
<cam>
<cameraType typeID="1" />
<position x="-26.90744" y="-2.035934" z="4.73512" />
<rotation x="31.03411" y="-1.992795E-06" z="85.52567" />
<lookAtAgent agentID="-1" />
<followAgent agentID="0" followOnX="true" followOnY="false" lockFirstPerson="false" />
<cameraType typeID="2" />
<position x="-32.01872" y="-1.759027" z="3.32442" />
<rotation x="30.5008" y="3.963564E-06" z="88.99989" />
<lookAtAgent agentID="2" />
<followAgent agentID="-1" followOnX="true" followOnY="true" lockFirstPerson="false" />
<CamResolution x="-1" y="-1" />
</cam>
<recording start="0" end="0" framerate="15" width="320" height="240">
......
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