Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My branch-1 #13

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
9,844 changes: 2,542 additions & 7,302 deletions Assets/Art/Prefabs/House.prefab

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
162 changes: 162 additions & 0 deletions Assets/Scenes/MainMenu.unity
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,71 @@ NavMeshSettings:
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1001 &466576513
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 9192946658940668405, guid: 5fb9d3aeda3456c4c884e223e16fb778, type: 3}
propertyPath: m_Name
value: SoundService
objectReference: {fileID: 0}
- target: {fileID: 9192946658940668406, guid: 5fb9d3aeda3456c4c884e223e16fb778, type: 3}
propertyPath: audioEffects
value:
objectReference: {fileID: 1040280548}
- target: {fileID: 9192946658940668406, guid: 5fb9d3aeda3456c4c884e223e16fb778, type: 3}
propertyPath: backgroundMusic
value:
objectReference: {fileID: 1040280548}
- target: {fileID: 9192946658940668407, guid: 5fb9d3aeda3456c4c884e223e16fb778, type: 3}
propertyPath: m_RootOrder
value: 4
objectReference: {fileID: 0}
- target: {fileID: 9192946658940668407, guid: 5fb9d3aeda3456c4c884e223e16fb778, type: 3}
propertyPath: m_LocalPosition.x
value: 932.06714
objectReference: {fileID: 0}
- target: {fileID: 9192946658940668407, guid: 5fb9d3aeda3456c4c884e223e16fb778, type: 3}
propertyPath: m_LocalPosition.y
value: 523.13654
objectReference: {fileID: 0}
- target: {fileID: 9192946658940668407, guid: 5fb9d3aeda3456c4c884e223e16fb778, type: 3}
propertyPath: m_LocalPosition.z
value: 4.468608
objectReference: {fileID: 0}
- target: {fileID: 9192946658940668407, guid: 5fb9d3aeda3456c4c884e223e16fb778, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9192946658940668407, guid: 5fb9d3aeda3456c4c884e223e16fb778, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9192946658940668407, guid: 5fb9d3aeda3456c4c884e223e16fb778, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9192946658940668407, guid: 5fb9d3aeda3456c4c884e223e16fb778, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9192946658940668407, guid: 5fb9d3aeda3456c4c884e223e16fb778, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9192946658940668407, guid: 5fb9d3aeda3456c4c884e223e16fb778, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9192946658940668407, guid: 5fb9d3aeda3456c4c884e223e16fb778, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 5fb9d3aeda3456c4c884e223e16fb778, type: 3}
--- !u!1 &678034816
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -365,6 +430,7 @@ GameObject:
- component: {fileID: 1040280544}
- component: {fileID: 1040280543}
- component: {fileID: 1040280547}
- component: {fileID: 1040280548}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
Expand Down Expand Up @@ -467,6 +533,102 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
playButton: {fileID: 1583849067}
--- !u!82 &1040280548
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1040280542}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 8300000, guid: fd85da68db32afe4c990c066ed309ef1, type: 3}
m_PlayOnAwake: 1
m_Volume: 1
m_Pitch: 1
Loop: 0
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!1 &1199653197
GameObject:
m_ObjectHideFlags: 0
Expand Down
53 changes: 1 addition & 52 deletions Assets/Scripts/Camera/CameraView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,8 @@ public class CameraView : MonoBehaviour

private float sensitivity = 1f;
private const float rotationLimit = 0.5f;
private Coroutine shakeCorroutine;

private void OnEnable()
{
EventService.Instance.LightsOffByGhostEvent.AddListener(Shake);
EventService.Instance.PlayerDeathEvent.AddListener(Shake);
EventService.Instance.RatRushEvent.AddListener(Shake);
EventService.Instance.SkullDropEvent.AddListener(Shake);
}

private void OnDisable()
{
EventService.Instance.LightsOffByGhostEvent.RemoveListener(Shake);
EventService.Instance.PlayerDeathEvent.RemoveListener(Shake);
EventService.Instance.RatRushEvent.RemoveListener(Shake);
EventService.Instance.SkullDropEvent.RemoveListener(Shake);
}

private void Start()
{
originalPosition = transform.localPosition;
}
private void Start() => originalPosition = transform.localPosition;

private void Update()
{
Expand All @@ -49,35 +29,4 @@ private void cameraMovement()
transform.Rotate(-velocity, 0, 0);
}
}

private void Shake()
{
if (shakeCorroutine != null)
stopCoroutine(shakeCorroutine);
shakeCorroutine = StartCoroutine(ShakeCoroutine(defaultShakeDuration, defaultShakeMagnitude));
}

private IEnumerator ShakeCoroutine(float shakeDuration, float shakeMagnitude)
{
float elapsedTime = 0f;

while (elapsedTime < shakeDuration)
{
float x = Random.Range(-shakeMagnitude, shakeMagnitude);
float y = Random.Range(-shakeMagnitude, shakeMagnitude);
transform.localPosition = new Vector3(originalPosition.x + x, originalPosition.y, originalPosition.z);
elapsedTime += Time.deltaTime;

yield return null;
}

transform.localPosition = originalPosition;
stopCoroutine(shakeCorroutine);
}

private void stopCoroutine(Coroutine coroutine)
{
StopCoroutine(coroutine);
coroutine = null;
}
}
8 changes: 0 additions & 8 deletions Assets/Scripts/Events.meta

This file was deleted.

18 changes: 0 additions & 18 deletions Assets/Scripts/Events/EventController.cs

This file was deleted.

11 changes: 0 additions & 11 deletions Assets/Scripts/Events/EventController.cs.meta

This file was deleted.

17 changes: 0 additions & 17 deletions Assets/Scripts/Events/LightsOffByGhostEvent.cs

This file was deleted.

11 changes: 0 additions & 11 deletions Assets/Scripts/Events/LightsOffByGhostEvent.cs.meta

This file was deleted.

15 changes: 0 additions & 15 deletions Assets/Scripts/Events/PlayerEscapedEvent.cs

This file was deleted.

11 changes: 0 additions & 11 deletions Assets/Scripts/Events/PlayerEscapedEvent.cs.meta

This file was deleted.

51 changes: 0 additions & 51 deletions Assets/Scripts/Events/RatRushEvent.cs

This file was deleted.

Loading