59 lines
1.2 KiB
C#
59 lines
1.2 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class HandleFishingRodVFXOnInteraction : MonoBehaviour
|
|
{
|
|
[SerializeField] private List<GameObject> weapons = new List<GameObject>();
|
|
[SerializeField] private GameObject fishingRod;
|
|
|
|
|
|
private void Awake()
|
|
{
|
|
ToggleFishingRod(false);
|
|
}
|
|
|
|
public void ToggleFishingRod(bool fishing)
|
|
{
|
|
for (int i = 0; i < weapons.Count; i++)
|
|
{
|
|
weapons[i].SetActive(!fishing);
|
|
}
|
|
fishingRod.SetActive(fishing);
|
|
}
|
|
|
|
public void OnFishingStarted()
|
|
{
|
|
for (int i = 0; i < weapons.Count; i++)
|
|
{
|
|
weapons[i].SetActive(false);
|
|
}
|
|
Invoke(nameof(DelayedFishingRod), 1f);
|
|
}
|
|
|
|
private void DelayedFishingRod()
|
|
{
|
|
fishingRod.SetActive(true);
|
|
}
|
|
|
|
public void OnFishingEnding()
|
|
{
|
|
for (int i = 0; i < weapons.Count; i++)
|
|
{
|
|
weapons[i].SetActive(false);
|
|
}
|
|
fishingRod.SetActive(false);
|
|
}
|
|
|
|
|
|
public void OnFishingEnded()
|
|
{
|
|
for (int i = 0; i < weapons.Count; i++)
|
|
{
|
|
weapons[i].SetActive(true);
|
|
}
|
|
fishingRod.SetActive(false);
|
|
}
|
|
}
|
|
|