fixed player in bot fights and their scaled time features (player not time scaled). Now player can join to fights for justice.
This commit is contained in:
@ -1,47 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class CameraMouseScript : MonoBehaviour
|
||||
{
|
||||
public float moveSpeed;
|
||||
public float shiftAdditionalSpeed;
|
||||
public float mouseSensitivity;
|
||||
public bool invertMouse;
|
||||
public bool autoLockCursor;
|
||||
|
||||
public Camera cam;
|
||||
|
||||
public GameObject character;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
cam = this.gameObject.GetComponent<Camera>();
|
||||
this.gameObject.name = "SpectatorCamera";
|
||||
Cursor.lockState = (autoLockCursor) ? CursorLockMode.Locked : CursorLockMode.None;
|
||||
}
|
||||
|
||||
void Update () {
|
||||
if (character.transform.rotation.x < 15 && character.transform.rotation.x > -15)
|
||||
{
|
||||
float speed = (moveSpeed + (Input.GetAxis("Fire3") * shiftAdditionalSpeed));
|
||||
this.gameObject.transform.Translate(Vector3.forward * speed * Input.GetAxis("Vertical"));
|
||||
this.gameObject.transform.Translate(Vector3.right * speed * Input.GetAxis("Horizontal"));
|
||||
this.gameObject.transform.Translate(Vector3.up * speed *
|
||||
(Input.GetAxis("Jump") + (Input.GetAxis("Fire1") * -1)));
|
||||
this.gameObject.transform.Rotate(Input.GetAxis("Mouse Y") * mouseSensitivity * ((invertMouse) ? 1 : -1),
|
||||
Input.GetAxis("Mouse X") * mouseSensitivity * ((invertMouse) ? -1 : 1), 0);
|
||||
this.gameObject.transform.localEulerAngles = new Vector3(this.gameObject.transform.localEulerAngles.x,
|
||||
this.gameObject.transform.localEulerAngles.y, 0);
|
||||
|
||||
if (Cursor.lockState == CursorLockMode.None && Input.GetMouseButtonDown(0))
|
||||
{
|
||||
Cursor.lockState = CursorLockMode.Locked;
|
||||
}
|
||||
else if (Cursor.lockState == CursorLockMode.Locked && Input.GetKeyDown(KeyCode.Escape))
|
||||
{
|
||||
Cursor.lockState = CursorLockMode.None;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Character/CameraMouseScript.cs.meta
generated
11
Assets/Scripts/Character/CameraMouseScript.cs.meta
generated
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e63e19e155f6b6348897150b67863072
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -26,7 +26,6 @@ public class Player : MonoBehaviour, ICharacter
|
||||
PlayerCharacter.LastTimeHit = TimeManager.Instance.CurrentTime;
|
||||
Condition.GiveHealth(-Mathf.RoundToInt(damage * (1 - Condition.ArmourPoints * 0.5f)));
|
||||
Condition.GiveArmour(-Mathf.RoundToInt(Mathf.Sqrt(damage) * 5));
|
||||
print(Condition.HealthPoints);
|
||||
if (Condition.HealthPoints < 10)
|
||||
Die();
|
||||
}
|
||||
|
Reference in New Issue
Block a user