using System.Collections.Generic; using UFS2.Gameplay; using UnityEngine; using UnityEngine.Rendering.PostProcessing; namespace OLDCODE { public class EagleEyes : MonoBehaviour { public Material eyeFishMaterial; public GameObject coolDownCanvasPrefab; private CoolDownEagle currentCooldown; private FFishSystem fishSystem; public bool isFishView; private bool isReady = true; private bool isView; private float currentViewTimer; private float eagleAffectProgress; private PostProcessVolume postProcessVolume; private ColorGrading colorGrading; private Vignette vignette; private float vignetteStartValue; public float startCameraFov; private List allEyesMaterials; public AudioSource audioSourceHearth; public AudioSource audioSourceFalcon; private List shownFish = new List(); private void Start() { if (FScriptsHandler.Instance != null) { startCameraFov = FScriptsHandler.Instance.m_PlayerMain.m_Camera.fieldOfView; } if (Singleton.Instance.HasCurrentPlayerSkill(GameManager.Skills.eagle_sens)) { if (GameManager.Instance._playerData.eagleEyesViewTimer != 10f) { GameManager.Instance._playerData.eagleEyesViewTimer = 10f; } } else if (Singleton.Instance.HasCurrentPlayerSkill(GameManager.Skills.Eagle_eye)) { if (GameManager.Instance._playerData.eagleEyesViewTimer != 5f) { GameManager.Instance._playerData.eagleEyesViewTimer = 5f; } } else { GameManager.Instance._playerData.eagleEyesViewTimer = 0f; } allEyesMaterials = new List(); fishSystem = GetComponent(); eyeFishMaterial.SetFloat("_Opacity", 0f); if (!GameObject.FindGameObjectWithTag("ScenePostProcessing").TryGetComponent(out postProcessVolume)) { Debug.LogError("EagleEye nie widzi Postprocesing"); } else { if (!postProcessVolume.profile.TryGetSettings(out colorGrading)) { Debug.LogError("EagleEye nie widzi Colorgrading"); } if (!postProcessVolume.profile.TryGetSettings(out vignette)) { Debug.LogError("EagleEye nie widzi Vignette"); } else { vignetteStartValue = vignette.intensity.value; } } if (GameManager.Instance._playerData.eagleEyesCoolDown > 0f) { currentCooldown = Object.Instantiate(coolDownCanvasPrefab, FScriptsHandler.Instance.m_Canvas.transform).GetComponent(); if (Singleton.Instance.HasCurrentPlayerSkill(GameManager.Skills.eagle_sens)) { currentCooldown.StartCooldown(CoolDownEagle.Type.Falcon); } else if (Singleton.Instance.HasCurrentPlayerSkill(GameManager.Skills.Eagle_eye)) { currentCooldown.StartCooldown(CoolDownEagle.Type.Eagle); } } } private void Update() { if (!FScriptsHandler.Instance || Singleton.Instance.IsCameraZoomIn || Singleton.Instance.IsZoomPlaying) { return; } if ((bool)FScriptsHandler.Instance.m_PlayerMain.currentRod && (FScriptsHandler.Instance.m_PlayerMain.currentRod.CheckIsInUse() || (bool)FScriptsHandler.Instance.m_PlayerMain.currentRod.currentFish)) { isReady = false; } if (InputManager.isEagleEye && isReady && !currentCooldown && !isView && GameManager.Instance._playerData.eagleEyesViewTimer > 0f) { if (currentViewTimer == 0f) { currentViewTimer = GameManager.Instance._playerData.eagleEyesViewTimer; } isView = true; startCameraFov = GameCameraController.GetCurrentFov(); } else if (!InputManager.isEagleEye && isView) { isView = false; } _ = isView; audioSourceHearth.volume = eagleAffectProgress * 0.2f; audioSourceFalcon.volume = eagleAffectProgress * 0.3f; } private void ShowFishes() { } private void HideFishes() { } } }