Smooth 3C & simplify hallucination trigger
This commit is contained in:
+10
-4
@@ -1,7 +1,8 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using Unheimlich.Core;
|
||||
using Unheimlich.Core.Audio;
|
||||
using Unheimlich.Features.OctoArms;
|
||||
using InputManager = Unheimlich.Core.Input.InputManager;
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
@@ -73,12 +74,11 @@ public class DiapasonEquipmentManager : MonoBehaviour
|
||||
{
|
||||
CheckForSoundEmitters();
|
||||
|
||||
if (Mouse.current != null && Mouse.current.leftButton.wasPressedThisFrame)
|
||||
var fireAction = InputManager.GetFireAction();
|
||||
if (fireAction != null && fireAction.WasPressedThisFrame())
|
||||
{
|
||||
if (CanTap)
|
||||
{
|
||||
TapDiapason();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -200,6 +200,8 @@ public class DiapasonEquipmentManager : MonoBehaviour
|
||||
|
||||
private void OnDiapasonEquipped()
|
||||
{
|
||||
PlayerEvents.TriggerDiapasonEquip();
|
||||
|
||||
if (_diapasonAnimator != null)
|
||||
{
|
||||
_diapasonAnimator.enabled = true;
|
||||
@@ -216,6 +218,8 @@ public class DiapasonEquipmentManager : MonoBehaviour
|
||||
|
||||
private void OnDiapasonUnequipped()
|
||||
{
|
||||
PlayerEvents.TriggerDiapasonUnequip();
|
||||
|
||||
_isVibrating = false;
|
||||
_diapasonAnimator = null;
|
||||
_diapasonParticles = null;
|
||||
@@ -270,6 +274,8 @@ public class DiapasonEquipmentManager : MonoBehaviour
|
||||
{
|
||||
_currentDetectedEmitter.StartListening(transform.position);
|
||||
}
|
||||
|
||||
PlayerEvents.TriggerDiapasonTap();
|
||||
|
||||
if (_vibrationCoroutine != null)
|
||||
StopCoroutine(_vibrationCoroutine);
|
||||
|
||||
+4
-21
@@ -42,28 +42,9 @@ namespace Unheimlich.Features.Diapason
|
||||
_playerAudioSource = gameObject.AddComponent<AudioSource>();
|
||||
|
||||
_cameraHeadBob = GetComponentInChildren<CameraHeadBob>();
|
||||
|
||||
if (PlayerController.Instance != null)
|
||||
{
|
||||
SubscribeToEquipmentEvents();
|
||||
}
|
||||
}
|
||||
|
||||
void OnDestroy()
|
||||
{
|
||||
if (PlayerController.Instance != null && PlayerController.Instance.DiapasonEquipment != null)
|
||||
{
|
||||
UnsubscribeFromEquipmentEvents();
|
||||
}
|
||||
}
|
||||
|
||||
private void SubscribeToEquipmentEvents()
|
||||
{
|
||||
}
|
||||
|
||||
private void UnsubscribeFromEquipmentEvents()
|
||||
{
|
||||
}
|
||||
void OnDestroy() { }
|
||||
|
||||
void Update()
|
||||
{
|
||||
@@ -93,7 +74,8 @@ namespace Unheimlich.Features.Diapason
|
||||
|
||||
if (_listeningCoroutine != null)
|
||||
StopCoroutine(_listeningCoroutine);
|
||||
|
||||
|
||||
PlayerEvents.TriggerEnterListening();
|
||||
_listeningCoroutine = StartCoroutine(ListeningSequence());
|
||||
}
|
||||
|
||||
@@ -181,6 +163,7 @@ namespace Unheimlich.Features.Diapason
|
||||
}
|
||||
|
||||
InputManager.SetContext(InputManager.InputContext.Normal);
|
||||
PlayerEvents.TriggerExitListening();
|
||||
|
||||
Cursor.lockState = CursorLockMode.Locked;
|
||||
Cursor.visible = false;
|
||||
|
||||
Reference in New Issue
Block a user