93 lines
3.5 KiB
C#
93 lines
3.5 KiB
C#
using BigSpace.XRCore.Event;
|
|
using BigSpace.Logic;
|
|
using UnityEngine;
|
|
using UnityEngine.Playables;
|
|
|
|
public class MySingnalReceiver : MonoBehaviour,INotificationReceiver
|
|
{
|
|
public void OnNotify(Playable origin, INotification notification, object context)
|
|
{
|
|
if (notification is MySingnal) // 接收到timeline事件
|
|
{
|
|
MySingnal singnal = (MySingnal)notification;
|
|
|
|
Debug.Log("触发了:" + singnal.sigParm1);
|
|
Debug.Log("2触发了:" + singnal.sigName);
|
|
if (singnal.sigName == "JumpScene") //跳转场景
|
|
{
|
|
//if (singnal.sigParm1 == 10002)
|
|
//{
|
|
// SceneMgr.Instance.LoadScene(10009);
|
|
//}
|
|
//else
|
|
//{ SceneMgr.Instance.LoadScene(singnal.sigParm1); }
|
|
SceneMgr.Instance.nowSceneId = singnal.sigParm1;
|
|
SceneMgr.Instance.LoadScene(singnal.sigParm1);
|
|
}
|
|
else if (singnal.sigName == "CheckPosition") //检测位置
|
|
{
|
|
GlobalEventMgr.Dispatch(GameEvent.EventCheckBoxCollider, singnal.sigParm1);
|
|
}
|
|
else if (singnal.sigName == "WaitCheckExit")//等待检测出界
|
|
{
|
|
GlobalEventMgr.Dispatch(GameEvent.EventWaitCheckExit, singnal.sigParm1);
|
|
}
|
|
else if (singnal.sigName == "CameraShake") //相机振动
|
|
{
|
|
GlobalEventMgr.Dispatch(GameEvent.EventCameraShake);
|
|
}
|
|
else if (singnal.sigName == "SetHandRay") //设置手上射线
|
|
{
|
|
if (singnal.sigParm1 == 1)
|
|
GlobalEventMgr.Dispatch(GameEvent.EventSetHandRay, true);
|
|
else
|
|
GlobalEventMgr.Dispatch(GameEvent.EventSetHandRay, false);
|
|
}
|
|
else if (singnal.sigName == "ShowUI") //显示UI
|
|
{
|
|
GlobalEventMgr.Dispatch(GameEvent.EventShowUI, 7);
|
|
}
|
|
else if (singnal.sigName == "RestScene") //可以还原场景了
|
|
{
|
|
ChangSceneSphereMgr.Instance.ShowChangeSecne(true,true);//黑球变黑
|
|
}
|
|
else if (singnal.sigName == "GameEnd") //游戏结束
|
|
{
|
|
//if (RoomNetwork.Ins != null)
|
|
// RoomNetwork.Ins.GameEnd();
|
|
//else
|
|
Application.Quit();
|
|
}
|
|
else if (singnal.sigName == "CatchAnimalState")//抓取动物
|
|
{
|
|
GlobalEventMgr.Dispatch(GameEvent.EventCatchAnimalState, singnal.sigParm1);
|
|
}
|
|
else if (singnal.sigName == "HideQuad") //隐藏抓取字的射线碰撞
|
|
{
|
|
GlobalEventMgr.Dispatch(GameEvent.EventHideQuad);
|
|
}
|
|
else if (singnal.sigName == "ShowGuide")
|
|
{
|
|
GlobalEventMgr.Dispatch(GameEvent.EventShowGuide, singnal.sigParm1);
|
|
}
|
|
else if (singnal.sigName == "ShowSound")
|
|
{
|
|
GlobalEventMgr.Dispatch(GameEvent.EventShowSound);
|
|
}
|
|
else if (singnal.sigName == "ShowMeesage")
|
|
{
|
|
//GlobalEventMgr.Dispatch(GameEvent.EventShowMessage, singnal.sigParm1);
|
|
}
|
|
else if (singnal.sigName == "ShowWenDu") //显示温度
|
|
{
|
|
//GlobalEventMgr.Dispatch(GameEvent.EventShowWenDu);
|
|
}
|
|
else if (singnal.sigName == "PlayTimeLineSound") //播放声音
|
|
{
|
|
//GlobalEventMgr.Dispatch(GameEvent.EventPlayTimeLineSound, singnal.sigParm1);
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|