28 lines
635 B
C#
28 lines
635 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Other : MonoBehaviour
|
|
{
|
|
void Start()
|
|
{
|
|
EventCenter.GetInstance().AddEventListener<Monster>("MonsterDead", OtherWaitMonsterDeadDo);
|
|
|
|
EventCenter.GetInstance().AddEventListener("Win", Win);
|
|
|
|
// EventCenter.GetInstance().EventTrigger<Monster>("MonsterDead", 怪物参数);
|
|
EventCenter.GetInstance().EventTrigger("Win");
|
|
|
|
}
|
|
|
|
public void OtherWaitMonsterDeadDo(Monster info)
|
|
{
|
|
Debug.Log("其他各个对象要做的事");
|
|
}
|
|
public void Win()
|
|
{
|
|
Debug.Log("无参事件中心");
|
|
}
|
|
|
|
}
|