44 lines
805 B
C#
44 lines
805 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UniRx;
|
|
|
|
public partial class BattleManager
|
|
{
|
|
[SerializeField]
|
|
SkillBubbleManager mSkillManager = null;
|
|
|
|
public enum eBATTLE_EVENT
|
|
{
|
|
SPAWN_SKILL,
|
|
RUN_SKILL,
|
|
}
|
|
|
|
public struct Message
|
|
{
|
|
public eBATTLE_EVENT BattleEvent;
|
|
|
|
public BattleCharacter Source;
|
|
}
|
|
|
|
public void Awake()
|
|
{
|
|
|
|
|
|
OnMessageBroker();
|
|
}
|
|
|
|
void OnMessageBroker()
|
|
{
|
|
MessageBroker.Default.Receive<Message>().Subscribe(msg =>
|
|
{
|
|
switch(msg.BattleEvent)
|
|
{
|
|
case eBATTLE_EVENT.SPAWN_SKILL:
|
|
mSkillManager.SpawnSkill(msg.Source);
|
|
break;
|
|
}
|
|
}).AddTo(this);
|
|
}
|
|
}
|