using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public enum EEventType
{
OnStartNormalGame,
OnChallengeStart,
OnReturnToHome,
OnReturnToHunting,
OnSynchronizeScore,
OnSynchronizeGold,
OnSynchronizeHeart,
OnSynchronizeKey,
OnSynchronizeAIChllengeModeAIData,
OnInitializeGame,
OnDistributeCardCompletedToCenter,
OnSynchronizeGameData,
MoveToStore_Heart,
MoveToStore_Heart_DuringGame,
MoveToStore_Key,
OnReturnFullView,
OnGameEnd,
OnSynchronizeNormalGameData,
OnReturnToGameFromStore,
/// [ECardType]
OnDiscard,
/// [int] textureIndex [string] script
OnClickFullView,
ShowPanel,
}
public class EventManager : MonoBehaviour
{
private Dictionary _dicBasicEvents_none;
private Dictionary> _dicBasicEvents_one;
private Dictionary> _dicBasicEvents_two;
private Dictionary> _dicBasicEvents_three;
private Dictionary> _dicBasicEvents_four;
private void Awake()
{
_dicBasicEvents_none = new Dictionary();
_dicBasicEvents_one = new Dictionary>();
_dicBasicEvents_two = new Dictionary>();
_dicBasicEvents_three = new Dictionary>();
_dicBasicEvents_four = new Dictionary>();
}
#region ## Regist and Remove ##
// Regist =====================================================================================
public void RegistEvent(EEventType evtType, System.Action action)
{
if (_dicBasicEvents_none.ContainsKey(evtType))
{
_dicBasicEvents_none[evtType] += action;
}
else
{
_dicBasicEvents_none.Add(evtType, action);
}
}
public void RegistEvent(EEventType evtType, System.Action