initial upload
This commit is contained in:
@ -0,0 +1,13 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace RootMotion.Demos {
|
||||
|
||||
// Safely getting out of full screen desktop builds
|
||||
public class ApplicationQuit : MonoBehaviour {
|
||||
|
||||
void Update () {
|
||||
if (Input.GetKeyDown(KeyCode.Q) || Input.GetKeyDown(KeyCode.Escape)) Application.Quit();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b2b7e342c712748b785bd6f84ed05e68
|
||||
timeCreated: 1452867515
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,30 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace RootMotion.Demos {
|
||||
|
||||
/// <summary>
|
||||
/// Going slow motion on user input
|
||||
/// </summary>
|
||||
public class SlowMo : MonoBehaviour {
|
||||
|
||||
public KeyCode[] keyCodes;
|
||||
public bool mouse0;
|
||||
public bool mouse1;
|
||||
public float slowMoTimeScale = 0.3f;
|
||||
|
||||
void Update () {
|
||||
Time.timeScale = IsSlowMotion()? slowMoTimeScale: 1f;
|
||||
}
|
||||
|
||||
private bool IsSlowMotion() {
|
||||
if (mouse0 && Input.GetMouseButton(0)) return true;
|
||||
if (mouse1 && Input.GetMouseButton(1)) return true;
|
||||
|
||||
for (int i = 0; i < keyCodes.Length; i++) {
|
||||
if (Input.GetKey(keyCodes[i])) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1a3904f1ea7c846159c7892541ba85cd
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user