64 lines
1.6 KiB
C#
64 lines
1.6 KiB
C#
using System.Collections.Generic;
|
|
using RuntimeData;
|
|
using UnityEngine;
|
|
using Logic;
|
|
using TH1_Logic.Core;
|
|
|
|
namespace TH1Renderer
|
|
{
|
|
|
|
public enum EffectTypeEnum
|
|
{
|
|
Fog,
|
|
Fire,
|
|
Attack
|
|
};
|
|
|
|
|
|
public class EffectManager
|
|
{
|
|
private Main _main;
|
|
private MapData _mapData;
|
|
|
|
public GameObject ROEffectPlayground;
|
|
public Dictionary<EffectTypeEnum, string> EffectPath = new Dictionary<EffectTypeEnum, string>();
|
|
|
|
public EffectManager(Main main, MapData mapData)
|
|
{
|
|
_main = main;
|
|
_mapData = mapData;
|
|
Init();
|
|
}
|
|
|
|
void Init()
|
|
{
|
|
EffectPath[EffectTypeEnum.Attack] = "Animations/Effect/Attack";
|
|
EffectPath[EffectTypeEnum.Fog] = "Animations/Effect/Fog";
|
|
EffectPath[EffectTypeEnum.Fire] = "Animations/Effect/Fire";
|
|
}
|
|
|
|
|
|
// Start is called before the first frame update
|
|
void Upadate()
|
|
{
|
|
|
|
}
|
|
public void PlayEffect(EffectTypeEnum effectType, MapData mapData, UnitData unitData)
|
|
{
|
|
if (!mapData.GetGridDataByUnitId(unitData.Id, out var grid))
|
|
return;
|
|
PlayerEffect(effectType, mapData, Table.Instance.GridToWorld(grid));
|
|
}
|
|
|
|
public void PlayEffect(EffectTypeEnum effectType, MapData mapData, GridData gridData)
|
|
{
|
|
PlayerEffect(effectType, mapData, Table.Instance.GridToWorld(gridData));
|
|
}
|
|
|
|
public void PlayerEffect(EffectTypeEnum effectType, MapData mapData, Vector3 worldPosition)
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|