41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class NecroAutoSummonOnSceneRefresh : MonoBehaviour
|
|
{
|
|
public List<BaseAbility> possibleAutoSummons = new List<BaseAbility>();
|
|
|
|
protected RiftPlayer player;
|
|
|
|
BaseAbility autocastAbility;
|
|
|
|
int index = 0;
|
|
|
|
private void Awake()
|
|
{
|
|
player = GetComponentInParent<RiftPlayer>();
|
|
|
|
index = PlayerPrefs.GetInt(GameConstants.PlayerPrefsKeys.NecroAutoSummonOnSceneRefreshIndexKey, 0);
|
|
index %= possibleAutoSummons.Count;
|
|
}
|
|
|
|
private IEnumerator Start()
|
|
{
|
|
yield return new WaitForSeconds(1f);
|
|
|
|
autocastAbility = possibleAutoSummons[index];
|
|
(autocastAbility as SummonAbility).AutoSummonOnSceneLoad(player.photonView);
|
|
yield return new WaitForSeconds(0.5f);
|
|
|
|
index++;
|
|
|
|
autocastAbility = possibleAutoSummons[index];
|
|
(autocastAbility as SummonAbility).AutoSummonOnSceneLoad(player.photonView);
|
|
|
|
index++;
|
|
|
|
PlayerPrefs.SetInt(GameConstants.PlayerPrefsKeys.NecroAutoSummonOnSceneRefreshIndexKey, (index %= possibleAutoSummons.Count));
|
|
}
|
|
}
|