63 lines
1.6 KiB
C#
63 lines
1.6 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class InteractableRift : Interactable
|
|
{
|
|
[Header("Visual Components:")]
|
|
[SerializeField] private GameObject openning;
|
|
[SerializeField] private GameObject maintain;
|
|
[SerializeField] private GameObject closing;
|
|
[Header("Events:")]
|
|
[SerializeField] private GameEvent_JobInstance onJobSelected;
|
|
|
|
public JobInstance bonusRiftInstance;
|
|
|
|
IEnumerator Start()
|
|
{
|
|
bonusRiftInstance = JobManager.Instance.currentlyGeneratedRiftRaid;
|
|
|
|
SetVisual(0);
|
|
|
|
yield return new WaitForSeconds(0.8f);
|
|
|
|
SetVisual(1);
|
|
}
|
|
|
|
public override void Interact(bool melee)
|
|
{
|
|
base.Interact(melee);
|
|
|
|
onJobSelected.Raise(bonusRiftInstance);
|
|
}
|
|
|
|
private void SetVisual(int index)
|
|
{
|
|
switch (index)
|
|
{
|
|
case -1:
|
|
openning.SetActive(false);
|
|
maintain.SetActive(false);
|
|
closing.SetActive(false);
|
|
break;
|
|
case 0:
|
|
openning.SetActive(true);
|
|
maintain.SetActive(false);
|
|
closing.SetActive(false);
|
|
break;
|
|
case 1:
|
|
openning.SetActive(false);
|
|
maintain.SetActive(true);
|
|
closing.SetActive(false);
|
|
break;
|
|
case 2:
|
|
openning.SetActive(false);
|
|
maintain.SetActive(false);
|
|
closing.SetActive(true);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|