Attention une mise à jour du service Gitlab va être effectuée le mardi 30 novembre entre 17h30 et 18h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes. Cette mise à jour intermédiaire en version 14.0.12 nous permettra de rapidement pouvoir mettre à votre disposition une version plus récente.

Commit ae4dae89 authored by ATREVI Dieudonne's avatar ATREVI Dieudonne
Browse files

Fix first person mode in console

parent 330a3b93
...@@ -118,7 +118,6 @@ public class CamMvt : MonoBehaviour ...@@ -118,7 +118,6 @@ public class CamMvt : MonoBehaviour
} }
#endregion #endregion
#region run time functions #region run time functions
///-------------------------------------------- ///--------------------------------------------
///----- run - time functions ----------------- ///----- run - time functions -----------------
...@@ -193,11 +192,7 @@ public class CamMvt : MonoBehaviour ...@@ -193,11 +192,7 @@ public class CamMvt : MonoBehaviour
if(current_camera_mode != camSelect.options[camSelect.value].text) if(current_camera_mode != camSelect.options[camSelect.value].text)
{ {
//PREVIOUS CAMERA deinitialization //PREVIOUS CAMERA deinitialization
if (current_camera_mode == DEFAULT) if (current_camera_mode == FREE_MOVMENT)
{
//
}
else if (current_camera_mode == FREE_MOVMENT)
{ {
// //
} }
...@@ -221,13 +216,8 @@ public class CamMvt : MonoBehaviour ...@@ -221,13 +216,8 @@ public class CamMvt : MonoBehaviour
//update //update
current_camera_mode = camSelect.options[camSelect.value].text; current_camera_mode = camSelect.options[camSelect.value].text;
//NEW CAMERA initialization //NEW CAMERA initialization
if (current_camera_mode == DEFAULT) if(current_camera_mode == FREE_MOVMENT)
{
//
}
else if(current_camera_mode == FREE_MOVMENT)
{ {
// //
} }
...@@ -309,6 +299,93 @@ public class CamMvt : MonoBehaviour ...@@ -309,6 +299,93 @@ public class CamMvt : MonoBehaviour
update_look_at_target(); update_look_at_target();
} }
} }
private void initialize_for_command_line()
{
//PREVIOUS CAMERA deinitialization
if (current_camera_mode == FOLLOW)
{
activateFollow = false;
}
else if (current_camera_mode == LOOK_AT)
{
activateLookAt = false;
}
else if (current_camera_mode == FIRST_PERSON)
{
activateFollow = false;
}
else if (current_camera_mode == TORSUM)
{
activateFollow = false;
}
//NEW CAMERA initialization
if (current_camera_mode == FOLLOW)
{
//activate and set 0 id in case or not predefined id
GameObject[] list = GameObject.FindGameObjectsWithTag("Player");
if (follow_Id < 0 && list.Length > 0)
{
follow_Id = 0;
}
activateFollow = true;
//set default rotation
transform.eulerAngles = _default_rotation;
}
else if (current_camera_mode == LOOK_AT)
{
//activate and set 0 id in case or not predefined id
GameObject[] list = GameObject.FindGameObjectsWithTag("Player");
if (lookAt_Id < 0 && list.Length > 0)
{
lookAt_Id = 0;
}
activateLookAt = true;
//set default position and rotation
transform.eulerAngles = _default_rotation;
transform.position = _default_position;
}
else if (current_camera_mode == FIRST_PERSON)
{
//activate and set 0 id in case or not predefined id
GameObject[] list = GameObject.FindGameObjectsWithTag("Player");
if (follow_Id < 0 && list.Length > 0)
{
follow_Id = 0;
}
activateFollow = true;
//set default rotation
update_follow_target();
transform.forward = agent_reference_transform.forward;
//initialize smooth value
smooth_y_head = agent_head_transform.position.y;
}
else if (current_camera_mode == TORSUM)
{
//activate and set 0 id in case or not predefined id
GameObject[] list = GameObject.FindGameObjectsWithTag("Player");
if (follow_Id < 0 && list.Length > 0)
{
follow_Id = 0;
}
activateFollow = true;
//set default rotation
update_follow_target();
transform.forward = agent_reference_transform.forward;
//initalize smooth value
smooth_y_torsum = agent_torsum_transform.position.y;
}
}
#endregion #endregion
#region events functions #region events functions
...@@ -387,6 +464,7 @@ public class CamMvt : MonoBehaviour ...@@ -387,6 +464,7 @@ public class CamMvt : MonoBehaviour
if (arguments.Length >1 && !Application.isEditor) if (arguments.Length >1 && !Application.isEditor)
{ {
camMovParamsCommandLine(); camMovParamsCommandLine();
initialize_for_command_line();
} }
else else
{ {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<position x="-22.27659" y="-2.188338" z="1.587071" /> <position x="-22.27659" y="-2.188338" z="1.587071" />
<rotation x="29.75006" y="-9.833855E-07" z="92.63902" /> <rotation x="29.75006" y="-9.833855E-07" z="92.63902" />
<lookAtAgent agentID="-1" /> <lookAtAgent agentID="-1" />
<followAgent agentID="2" followOnX="true" followOnY="true" lockFirstPerson="false" smoothFirstPerson="true" /> <followAgent agentID="2" followOnX="true" followOnY="true" lockFirstPerson="true" smoothFirstPerson="true" />
<CamResolution x="-1" y="-1" /> <CamResolution x="-1" y="-1" />
</cam> </cam>
<recording start="1" end="10" framerate="15" width="320" height="240"> <recording start="1" end="10" 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