Commit e5ab93b6 authored by JOVANE Alberto's avatar JOVANE Alberto
Browse files

added the lock first person view parameter in the config file

parent 1e23a6f9
......@@ -92,7 +92,9 @@ public class LoadEnv : MonoBehaviour
cam_Movement.follow_Id = ConfigReader.camFollowTarget;
cam_Movement.follow_LockX = !ConfigReader.camFollowOnX;
cam_Movement.follow_LockZ = !ConfigReader.camFollowOnY;
cam_Movement.lockFirstPersonView = ConfigReader.camLockFirstPerson;
// -------------
// RECORD CONFIG
cam_Rec.record = ConfigReader.recording;
......@@ -420,13 +422,15 @@ public class LoadEnv : MonoBehaviour
// CAMERA CONFIG
cam_Rec.enabled = true;
cam_Movement.enabled = true;
cam_Movement._camera_type = (CamMvt.CameraType)ConfigReader.camType;
cam.transform.position = ConfigReader.camPosition;
cam.transform.rotation = Quaternion.Euler(ConfigReader.camRotation);
cam_Movement.lookAt_Id = ConfigReader.camLookAtTarget;
cam_Movement.follow_Id = ConfigReader.camFollowTarget;
cam_Movement.follow_LockX = !ConfigReader.camFollowOnX;
cam_Movement.follow_LockZ = !ConfigReader.camFollowOnY;
cam_Movement.lockFirstPersonView = ConfigReader.camLockFirstPerson;
// -------------
// RECORD CONFIG
cam_Rec.record = ConfigReader.recording;
......
......@@ -78,7 +78,7 @@ public class CamMvt : MonoBehaviour
void Start()
{
//_camera_type = CameraType.Default;
lockFirstPersonView = false;
//lockFirstPersonView = false;
}
/// <summary>
......
......@@ -181,6 +181,14 @@ public static class ConfigReader
set { data.cam.followAgent.followY = value;}
}
/// <summary>
/// Boolean, true if camera first person or torsum is stuck with the agent direction or free to move
/// </summary>
static public bool camLockFirstPerson
{
get { return data.cam.followAgent == null ? false : data.cam.followAgent.lockFirstPerson; }
set { data.cam.followAgent.lockFirstPerson = value; }
}
/// <summary>
/// Boolean, true if the animation should be recorded
/// </summary>
static public bool recording
......@@ -498,12 +506,15 @@ public class ConfigCamBehaviour2
public bool followX;
[XmlAttribute("followOnY")]
public bool followY;
[XmlAttribute("lockFirstPerson")]
public bool lockFirstPerson;
public ConfigCamBehaviour2()
{
id = -1;
followX = false;
followY = false;
lockFirstPerson = false;
}
}
......
......@@ -12,7 +12,7 @@
<position x="-30" y="-3" z="5" />
<rotation x="30.32365" y="0" z="92.53606" />
<lookAtAgent agentID="-1" />
<followAgent agentID="0" followOnX="true" followOnY="false" />
<followAgent agentID="0" followOnX="true" followOnY="false" 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