Merge branch 'DawidsBranch'

This commit is contained in:
Ignis 2021-08-23 17:32:07 +02:00
commit eeb9b1f0d2
4 changed files with 59 additions and 7 deletions

View file

@ -17,13 +17,8 @@ public class Dobber : MonoBehaviour
void Awake()
{
//i don't know why dose need to reference it's self but it's requiered to work
playerControls = new PlayerControls();
//automatically find rigidbody in character
rb = gameObject.GetComponent<Rigidbody>();
//lock rotation of the rigidbody
rb.constraints = RigidbodyConstraints.FreezeRotationZ | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationX;
//here we enable controlls for Dobber character
playerControls.DobberControls.Enable();
}
@ -52,8 +47,8 @@ public class Dobber : MonoBehaviour
void Move()
{
//new Vector3 for calculating movement values
Vector3 move = new Vector3(0, 0, moveVertical * 100 * moveSpeed * Time.deltaTime);
Quaternion rotate = Quaternion.Euler(transform.rotation.x, moveHorizontal * 100 * turnSpeed * Time.deltaTime, transform.rotation.z);
Vector3 move = new Vector3(0, 0, moveVertical * moveSpeed);
Quaternion rotate = Quaternion.Euler(transform.rotation.x, moveHorizontal * turnSpeed , transform.rotation.z);
//here we apply the movement related to the rotation of player
rb.velocity = transform.right * move.x + transform.up * move.y + transform.forward * move.z;
gameObject.transform.rotation = transform.rotation * rotate;

View file

@ -10,6 +10,7 @@
"com.unity.test-framework": "1.1.27",
"com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.4.8",
"com.unity.toolchain.win-x86_64-linux-x86_64": "0.1.21-preview",
"com.unity.ugui": "1.0.0",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",

View file

@ -106,6 +106,22 @@
},
"url": "https://packages.unity.com"
},
"com.unity.sysroot": {
"version": "0.1.19-preview",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.sysroot.linux-x86_64": {
"version": "0.1.14-preview",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.sysroot": "0.1.18-preview"
},
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
"version": "1.1.27",
"depth": 0,
@ -138,6 +154,16 @@
},
"url": "https://packages.unity.com"
},
"com.unity.toolchain.win-x86_64-linux-x86_64": {
"version": "0.1.21-preview",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.sysroot": "0.1.19-preview",
"com.unity.sysroot.linux-x86_64": "0.1.14-preview"
},
"url": "https://packages.unity.com"
},
"com.unity.ugui": {
"version": "1.0.0",
"depth": 0,

View file

@ -32,6 +32,36 @@
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"key": "lightmapping.autoUnwrapLightmapUV",
"value": "{\"m_Value\":true}"
},
{
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"key": "editor.backFaceSelectEnabled",
"value": "{\"m_Value\":false}"
},
{
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"key": "editor.toolbarIconGUI",
"value": "{\"m_Value\":false}"
},
{
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"key": "editor.showSceneInfo",
"value": "{\"m_Value\":false}"
},
{
"type": "UnityEngine.ProBuilder.SelectionModifierBehavior, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "editor.rectSelectModifier",
"value": "{\"m_Value\":2}"
},
{
"type": "UnityEngine.ProBuilder.RectSelectMode, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "editor.dragSelectRectMode",
"value": "{\"m_Value\":0}"
},
{
"type": "UnityEngine.ProBuilder.SelectMode, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "editor.selectMode",
"value": "{\"m_Value\":1}"
}
]
}