Removed 3D player model, reworked camera rotation (When going diagonal it is still possible to flip around, but thats fine I guess)
This commit is contained in:
parent
dd1b3db417
commit
eded2be2ef
@ -14,7 +14,19 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
m_TableCollectionName: MyAssets
|
||||
m_TableCollectionNameGuidString: be998aea26820a30aa2217983d31b9c7
|
||||
m_Entries: []
|
||||
m_Entries:
|
||||
- m_Id: 254999613279862784
|
||||
m_Key: GameScene/Controls
|
||||
m_Metadata:
|
||||
m_Items: []
|
||||
- m_Id: 254999710549966848
|
||||
m_Key: GameScene/Controls 1
|
||||
m_Metadata:
|
||||
m_Items: []
|
||||
- m_Id: 254999749116592128
|
||||
m_Key: GameScene/Controls 2
|
||||
m_Metadata:
|
||||
m_Items: []
|
||||
m_Metadata:
|
||||
m_Items: []
|
||||
m_KeyGenerator:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -56,11 +56,11 @@ public class Controls : MonoBehaviour
|
||||
if (uihandler.canPlayerRotate())
|
||||
{
|
||||
if(playerInput.currentControlScheme == "Controller"){
|
||||
playerCam.GetComponent<PlayerCamera>().LookUpAndDown(view, sensitivityController * multiplier);
|
||||
playerCam.GetComponent<PlayerCamera>().LookAround(view, sensitivityController * multiplier);
|
||||
player.GetComponent<PlayerGameObject>().rotate(view, sensitivityController * multiplier);
|
||||
}
|
||||
else{
|
||||
playerCam.GetComponent<PlayerCamera>().LookUpAndDown(view, sensitivityMouse * multiplier);
|
||||
playerCam.GetComponent<PlayerCamera>().LookAround(view, sensitivityMouse * multiplier);
|
||||
player.GetComponent<PlayerGameObject>().rotate(view, sensitivityMouse * multiplier);
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,16 +43,17 @@ namespace Assets.Scripts.Player
|
||||
return null;
|
||||
}
|
||||
|
||||
public void LookUpAndDown(Vector2 view, Vector2 speed)
|
||||
public void LookAround(Vector2 view, Vector2 speed)
|
||||
{
|
||||
GameObject target = GameObject.Find("targetLooking");
|
||||
target.transform.localPosition = target.transform.localPosition + new Vector3(0,view.y,0) * speed.y;// * Time.deltaTime;
|
||||
if(target.transform.localPosition.y >= 2){
|
||||
target.transform.localPosition = new Vector3(target.transform.localPosition.x,2f,target.transform.localPosition.z);
|
||||
if (transform.rotation.x <= -0.25)
|
||||
{
|
||||
if (view.y > 0) return;
|
||||
}
|
||||
if(target.transform.localPosition.y <= -1){
|
||||
target.transform.localPosition = new Vector3(target.transform.localPosition.x,-1f,target.transform.localPosition.z);
|
||||
if (transform.rotation.x >= 0.25)
|
||||
{
|
||||
if (view.y < 0) return;
|
||||
}
|
||||
transform.Rotate(Vector3.left, view.y * speed.y);
|
||||
}
|
||||
|
||||
void showInformation()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -4,4 +4,4 @@ Language:en
|
||||
Music:0
|
||||
Effects:0
|
||||
SensitivityController:1/1
|
||||
SensitivityMouse:34.76152/9.194521
|
||||
SensitivityMouse:42.32454/58.06303
|
||||
Loading…
x
Reference in New Issue
Block a user