32 lines
930 B
C#
32 lines
930 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class EventReigster : MonoBehaviour
|
|
{
|
|
//¶ÔÏ󳨵ã1
|
|
public RectTransform target1;
|
|
//¶ÔÏ󳨵ã2
|
|
public RectTransform target2;
|
|
|
|
void Awake()
|
|
{
|
|
EventCenter.Instance.AddEventListener<string>(E_EventType.E_Pool_Register1,PoolTarGet1);
|
|
EventCenter.Instance.AddEventListener<string>(E_EventType.E_Pool_Register2, PoolTarGet2);
|
|
}
|
|
|
|
private void PoolTarGet1(string str)
|
|
{
|
|
GameObject obj = PoolMgr.Instance.GetObj("Object/ToastTip");
|
|
obj.transform.SetParent(target1.transform, false);
|
|
obj.GetComponent<ToastTip>().UpdateTxtInfo(str);
|
|
}
|
|
private void PoolTarGet2(string str)
|
|
{
|
|
GameObject obj = PoolMgr.Instance.GetObj("Object/ToastTip");
|
|
obj.transform.SetParent(target2.transform, false);
|
|
obj.GetComponent<ToastTip>().UpdateTxtInfo(str);
|
|
}
|
|
|
|
}
|