2023-10-17 12:37:34 +03:00
|
|
|
using BNG;
|
2023-09-11 15:44:17 +03:00
|
|
|
using Dreamteck.Splines;
|
2023-09-05 17:38:11 +03:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
public class FinishController : MonoBehaviour
|
|
|
|
{
|
2023-09-11 15:44:17 +03:00
|
|
|
private ShipMoveSides _moveSides;
|
2023-09-18 20:09:22 +03:00
|
|
|
private MonumentController _monumentController;
|
2023-10-02 19:12:35 +03:00
|
|
|
private vTimerCounter _vTimerCounter;
|
2023-10-31 15:43:35 +03:00
|
|
|
private DisableAfterFinishController _disabler;
|
2023-10-23 12:07:14 +03:00
|
|
|
[SerializeField] private SteeringWheel _wheel;
|
2023-09-05 17:38:11 +03:00
|
|
|
|
|
|
|
private void Awake()
|
|
|
|
{
|
2023-10-30 17:26:19 +03:00
|
|
|
_moveSides = FindObjectOfType<PlayerInputHandler>().GetComponent<ShipMoveSides>();
|
2023-10-02 19:12:35 +03:00
|
|
|
_vTimerCounter = FindObjectOfType<vTimerCounter>();
|
|
|
|
_monumentController = FindObjectOfType<MonumentController>();
|
2023-10-31 15:43:35 +03:00
|
|
|
_disabler = FindObjectOfType<DisableAfterFinishController>();
|
2023-09-05 17:38:11 +03:00
|
|
|
}
|
|
|
|
|
2023-10-19 13:08:23 +03:00
|
|
|
public void OnFinish()
|
|
|
|
{
|
|
|
|
DisablePlayerMovement();
|
2023-10-31 15:43:35 +03:00
|
|
|
_disabler.Disabele();
|
2023-10-19 13:08:23 +03:00
|
|
|
_monumentController.UnlockMonument();
|
|
|
|
}
|
|
|
|
|
|
|
|
private void DisablePlayerMovement()
|
2023-09-05 17:38:11 +03:00
|
|
|
{
|
2023-10-23 12:07:14 +03:00
|
|
|
_wheel.DisableWheel();
|
2023-10-02 19:12:35 +03:00
|
|
|
_vTimerCounter.StopTimer();
|
2023-09-11 15:44:17 +03:00
|
|
|
_moveSides.ToggleInput(false);
|
2023-10-19 13:08:23 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
public void OnTimeEnd()
|
|
|
|
{
|
|
|
|
DisablePlayerMovement();
|
2023-09-05 17:38:11 +03:00
|
|
|
}
|
|
|
|
}
|