mirror of
https://github.com/ConjureETS/PixelSphinx.git
synced 2026-03-24 10:30:59 +00:00
Merge branch 'master' of https://github.com/ETSConjure/PixelSphinx
This commit is contained in:
commit
bf8d43e571
@ -40,7 +40,7 @@ AudioSource:
|
|||||||
OutputAudioMixerGroup: {fileID: 0}
|
OutputAudioMixerGroup: {fileID: 0}
|
||||||
m_audioClip: {fileID: 8300000, guid: 3d4d970a0bbdd934e95ffcf72fc5225c, type: 3}
|
m_audioClip: {fileID: 8300000, guid: 3d4d970a0bbdd934e95ffcf72fc5225c, type: 3}
|
||||||
m_PlayOnAwake: 0
|
m_PlayOnAwake: 0
|
||||||
m_Volume: 1
|
m_Volume: 0.01
|
||||||
m_Pitch: 1
|
m_Pitch: 1
|
||||||
Loop: 0
|
Loop: 0
|
||||||
Mute: 0
|
Mute: 0
|
||||||
|
|||||||
@ -86,7 +86,7 @@ AudioSource:
|
|||||||
OutputAudioMixerGroup: {fileID: 0}
|
OutputAudioMixerGroup: {fileID: 0}
|
||||||
m_audioClip: {fileID: 8300000, guid: 3d4d970a0bbdd934e95ffcf72fc5225c, type: 3}
|
m_audioClip: {fileID: 8300000, guid: 3d4d970a0bbdd934e95ffcf72fc5225c, type: 3}
|
||||||
m_PlayOnAwake: 0
|
m_PlayOnAwake: 0
|
||||||
m_Volume: 1
|
m_Volume: 0.01
|
||||||
m_Pitch: 1
|
m_Pitch: 1
|
||||||
Loop: 0
|
Loop: 0
|
||||||
Mute: 0
|
Mute: 0
|
||||||
@ -160,7 +160,7 @@ AudioSource:
|
|||||||
OutputAudioMixerGroup: {fileID: 0}
|
OutputAudioMixerGroup: {fileID: 0}
|
||||||
m_audioClip: {fileID: 8300000, guid: 3d4d970a0bbdd934e95ffcf72fc5225c, type: 3}
|
m_audioClip: {fileID: 8300000, guid: 3d4d970a0bbdd934e95ffcf72fc5225c, type: 3}
|
||||||
m_PlayOnAwake: 0
|
m_PlayOnAwake: 0
|
||||||
m_Volume: 1
|
m_Volume: 0.01
|
||||||
m_Pitch: 1
|
m_Pitch: 1
|
||||||
Loop: 0
|
Loop: 0
|
||||||
Mute: 0
|
Mute: 0
|
||||||
|
|||||||
36
Assets/Scripts/CameraShake.cs
Normal file
36
Assets/Scripts/CameraShake.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
public class CameraShake : MonoBehaviour
|
||||||
|
{
|
||||||
|
|
||||||
|
public float shakeTimeAmount = 0.0f;
|
||||||
|
public float shakeAmount = 0.7f;
|
||||||
|
public float decreaseFactor = 1.0f;
|
||||||
|
|
||||||
|
private Camera camera;
|
||||||
|
|
||||||
|
// Use this for initialization
|
||||||
|
public void Start ()
|
||||||
|
{
|
||||||
|
camera = gameObject.GetComponent<Camera>();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
public void FixedUpdate () {
|
||||||
|
if (shakeTimeAmount > 0)
|
||||||
|
{
|
||||||
|
var tempShakePosition = camera.transform.localPosition = Random.insideUnitSphere * shakeAmount;
|
||||||
|
tempShakePosition.z = -10f; // lock z from shaking...
|
||||||
|
camera.transform.localPosition = tempShakePosition; //
|
||||||
|
shakeTimeAmount -= Time.deltaTime * decreaseFactor;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
shakeTimeAmount = 0.0f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
12
Assets/Scripts/CameraShake.cs.meta
Normal file
12
Assets/Scripts/CameraShake.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 015d8005b8f2f454da584e55b55711f5
|
||||||
|
timeCreated: 1460231903
|
||||||
|
licenseType: Pro
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -1005,6 +1005,7 @@ GameObject:
|
|||||||
- 92: {fileID: 1945693980}
|
- 92: {fileID: 1945693980}
|
||||||
- 124: {fileID: 1945693979}
|
- 124: {fileID: 1945693979}
|
||||||
- 81: {fileID: 1945693978}
|
- 81: {fileID: 1945693978}
|
||||||
|
- 114: {fileID: 1945693983}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Main Camera
|
m_Name: Main Camera
|
||||||
m_TagString: MainCamera
|
m_TagString: MainCamera
|
||||||
@ -1079,3 +1080,17 @@ Transform:
|
|||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
|
--- !u!114 &1945693983
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1945693977}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 015d8005b8f2f454da584e55b55711f5, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
shakeTimeAmount: 2
|
||||||
|
shakeAmount: 0.6
|
||||||
|
decreaseFactor: 1
|
||||||
|
|||||||
@ -4,4 +4,6 @@
|
|||||||
EditorBuildSettings:
|
EditorBuildSettings:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Scenes: []
|
m_Scenes:
|
||||||
|
- enabled: 1
|
||||||
|
path: Assets/_Scenes/Main.unity
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user