Added Framecap
This commit is contained in:
18
Assets/AssetsFORELLE/Script/FPSTarget.cs
Normal file
18
Assets/AssetsFORELLE/Script/FPSTarget.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using UnityEngine;
|
||||
public class FPSTarget : MonoBehaviour
|
||||
{
|
||||
|
||||
public int target = 30;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
QualitySettings.vSyncCount = 0;
|
||||
Application.targetFrameRate = target;
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if(Application.targetFrameRate != target){
|
||||
Application.targetFrameRate = target;}
|
||||
}
|
||||
}
|
11
Assets/AssetsFORELLE/Script/FPSTarget.cs.meta
generated
Normal file
11
Assets/AssetsFORELLE/Script/FPSTarget.cs.meta
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7ac3ef522080e44c08e9a869c54f1e8e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -12,7 +12,7 @@ public class FallingDetection : MonoBehaviour
|
||||
public AudioClip landeSound; // The sound clip to be played
|
||||
public AudioClip sprungSound; // The sound clip to be played
|
||||
public bool isJumping = false;
|
||||
private int counterFall = 0;
|
||||
public int counterFall = 0;
|
||||
|
||||
|
||||
private void Start()
|
||||
@@ -37,11 +37,11 @@ public class FallingDetection : MonoBehaviour
|
||||
//Wenn nicht auf boden und geschwindigkeits offset neg
|
||||
if (!charController.grounded && velocity.y < -0.1f) {
|
||||
//Wenn er bereits fällt, oder der counter erreicht ist zum fallen
|
||||
if (isFalling || counter++>90) {
|
||||
if (isFalling || counter++>20) {
|
||||
isFalling = true;
|
||||
animator.SetBool("IsFalling", true);
|
||||
counter = 0;
|
||||
if(counterFall++>180){
|
||||
if(counterFall++>35){
|
||||
wasFallingbefore = true;}
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user